开发者

need php script to change video format from flv to any other format (mpeg,avi)

i want to convert flv video(downloaded from you tube) to any other format, i had search a lot, but every script changed any other format into flv while i need flv to any other format. please suggest me any link or php script that convert开发者_如何学JAVA flv to any other format.

one more question :why flv is preferred for video??

thanks.


Apart from using a 3rd party web service (I don't think there are free ones), there is no pure PHP solution for this. If you have web space / a web server with access to the commandline, try ffmpeg .

You can invoke ffmpeg using exec(), but there are also wrapper classes for PHP, e.g. here. There is also a PHP extension providing an interface to ffmpeg but that has to be installed on the server.

One reason to use the flv format at the moment is because (to my knowledge) it's the only video format supported by Flash players before Version 10, some of which are still around when users don't update frequently. The 10.x player generation supports the better H.264 format.


I suppose your could use ffmpeg to do that kind of conversion, calling it via exec() or an equivalent.
(I've seen quite a couple of questions/answers on SO that use ffmpeg to do some kind of video-conversion)


To answer the question about "why flv is preferred for video ?" : I suppose it's because :

  • Almost everyone has flash player installed in their browser
  • while not everyone has a video-player -- especially when you think about the multitude of exiting codecs
  • and using flash probably allows for better embedding of the videos in the browser

Well, at least, this is for now -- we'll see in some time, with HTML 5, if this still stands ^^


You can convert in reverse also, why not. See example below:

ffmpeg -i SOURCE.flv -f mp4 -vcodec mpeg4 -b 2200k -r 30 -s 640x360 -acodec libfaac -ar 32000 -ab 128k -ac 2 -threads 8 DEST.mp4

Of course you need required codecs for conversion.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜