rima_dhk — 2012-02-01T00:34:25-05:00 — #1
I want to create thumbnail from uploaded video in the website using ffmpeg and show the uploaded video from the front end of the site after creating thumbnail.How can i do this? Is it possible to create thumbnail during upload video in the website? Is there anyone can help me explain me this by example?
immerse — 2012-02-01T02:31:46-05:00 — #2
You cannot do this during upload, however, after upload you can create a thumbnail.
You'll need to run this on the command line:
ffmpeg -itsoffset -4 -i uploaded_movie.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 thumbnail.jpg
From PHP, after uploading and saving the file:
$output_file_name = '/var/www/your_site/images/thumbnail.jpg';
$cmd = 'ffmpeg -itsoffset -4 -i ' . $path_to_uploaded_file. ' -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 ' . $output_file_name;
rima_dhk — 2012-02-01T02:45:41-05:00 — #3
But can you please tell me which variable i will use to show the image? Please see the following code. In poster attribute which variable i have to pass?
<video src="Media/<?=$row['videofile']?>" height="370" id="container" poster="images/<?=$cmd?>" width="590"> </video>