Heim  >  Artikel  >  Backend-Entwicklung  >  PHP简单方式获取视频预览图

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

WBOY
WBOYOriginal
2016-07-25 08:42:311139Durchsuche
  1. convertToFlv( "some-video-input.avi", "output.jpg" );
  2. function convertToFlv( $input, $output ) {
  3. echo "Converting $input to $output
    ";
  4. $command = "ffmpeg -v 0 -y -i $input -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 $output ";
  5. echo "$command
    ";
  6. shell_exec( $command );
  7. echo "Converted
    ";
  8. }
  9. ?>
复制代码

PHP


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn