Iam使用ffmpeg和php为动态视频创建缩略图。它将缩略图保存到特定文件,然后使用php检索它。我想为所有类型的视频创建缩略图。 iam面临的ffmpeg问题是iam无法为带有.mp4扩展名的视频创建缩略图。 ?使用ffmpeg创建mp4的缩略图
<?
$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";
>
上述命令做工精细。但我仍然无法创建MP4视频的缩略图。除mp4外,还为所有其他视频创建缩略图。 – user1411837