![](/img/trans.png)
[英]Fastest way to extract a specific frame from a video (PHP/ffmpeg/anything)
[英]Use FFMPEG to get frame from a video on specific time (PHP)
我想使用FFMPEG,在PHP中的特定时间(由用户提供)上从视频中获取帧。 有人可以帮我吗? 我从未使用过FFMPEG。 提前致谢。
我找到了解决方案
//video dir
$video = 'Salient.avi';
//where to save the image
$image = 'testimage%d.jpg';
//time to take screenshot at
$interval = '00:00:12';
//screenshot size
$size = '535x346';
echo "Starting ffmpeg...\n\n<br>";
$cmd = "ffmpeg -i $video -ss $interval -f image2 -s $size -vframes 1 $image";
echo shell_exec($cmd);
echo "Done.\n";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.