Home >php教程 >PHP源码 >PHP简单获取视频预览图的方法

PHP简单获取视频预览图的方法

PHP中文网
PHP中文网Original
2016-05-25 17:14:471526browse

这篇文章主要介绍了PHP简单获取视频预览图的方法,涉及php操作多媒体文件的技巧,非常具有实用价值,需要的朋友可以参考下

本文实例讲述了PHP简单获取视频预览图的方法。分享给大家供大家参考。具体实现方法如下:

代码如下:

<?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 />";
}
?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn