Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php库从视频问题生成缩略图_Php_Ffmpeg - Fatal编程技术网

php库从视频问题生成缩略图

php库从视频问题生成缩略图,php,ffmpeg,Php,Ffmpeg,我正在尝试使用ffmpegphp库从MP4文件创建缩略图 我有 $ffmpeg ="/usr/bin/ffmpeg"; $image_source_path = '/project/a1/a1.mp4'; $ALL_PLACE_WIDTH = 300; $ALL_PLACE_HEIGHT = 270; $image_cmd = " -r 1 -r 0.0001 -s ".$ALL_PLACE_WIDTH."x".$ALL_PLACE_HEIGHT." -f image2 ";

我正在尝试使用
ffmpeg
php
库从
MP4
文件创建
缩略图

我有

 $ffmpeg ="/usr/bin/ffmpeg";

 $image_source_path = '/project/a1/a1.mp4';

 $ALL_PLACE_WIDTH = 300;
 $ALL_PLACE_HEIGHT = 270;

 $image_cmd = " -r 1 -r 0.0001 -s ".$ALL_PLACE_WIDTH."x".$ALL_PLACE_HEIGHT." -f image2 ";

 $dest_image_path = '/project/a1/foo-%03d.png';

 $str_command= $ffmpeg  ." -i " . $image_source_path . $image_cmd .$dest_image_path;

 shell_exec($str_command);
我只需要视频的第一帧,但我的代码将生成2个视频图像,这不是我想要的。有人能帮我解决这个问题吗

非常感谢