PHP简单方式获取视频预览图

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<?php
convertToFlv( "some-video-input.avi", "output.jpg" );

function convertToFlv( $input, $output ) {
   echo "Converting $input to $output<br />";
   $command = "ffmpeg -v 0 -y -i $input -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 $output ";
   echo "$command<br />";
   shell_exec( $command );
   echo "Converted<br />";
}
?>