开发者

How can I convert an AVI file to FLV format with PHP?

Is it possible to convert an AVI file to FLV format with PHP? If so, how? I don't need a comp开发者_StackOverflowlete solution, just a hint on how to do it.


ffmpeg is a great library for this sort of thing. Here's a walkthrough of the process:

http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/


It would be simpler to convert the video into Flash video and just use one of the many Flash video players out there. There is also an ffmpeg api for PHP, this would be a good place to start.


Assuming you have ffmpeg installed, you can do this:

<?php
   define('FFMPEG_LIBRARY', '/usr/local/bin/ffmpeg ');
   $exec_string = FFMPEG_LIBRARY.' -i inputfile.avi outputfile.flv';
   exec($exec_string);
?>


Call a command line transcoder like Mencoder or vlc. Alternatively, look for a PHP library which allows you to access a library like ffmpeg.


Try FFmpeg. Check the link

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜