Iam using ffmpeg with php to create thumbnails for videos on the fly .It saves the thumbnails to a particular file and then i retrieve it using php. I want to create thumbnails for all types of videos possible. The problem with ffmpeg that iam facing is that iam not able to create thumbnails for videos with .mp4 extensions.
<?
$ffmpeg = '/usr/bin/ffmpeg/ffmpeg'; //to load the extension ffmpeg
$video = '/path/to/video'.$file_thumb; //path to the video
$image = '/store/it/here'; //path to store the thumbnail
$interval = 5;
$size = '640x480';
//It runs with the below command
$cmd = "$ffmpeg -i $video -deinterlace -an -ss $interval -f mjpeg -t 1 -r 1 -y -s $size
$image 2>&1";
?>