What is the best tool to convert common video formats to FLV on a Linux CLI [closed]

蹲街弑〆低调 提交于 2019-11-30 06:56:18

Flash can play the following formats:

FLV with AAC or MP3 audio, and FLV1 (Sorenson Spark H.263), VP6, or H.264 video.
MP4 with AAC or MP3 audio, and H.264 video (mp4s must be hinted with qt-faststart or mp4box).

ffmpeg is an overall good conversion utility; mencoder works better with obscure and proprietary formats (due to the w32codecs binary decoder package) but its muxing is rather suboptimal (read: often totally broken). One solution might be to encode H.264 with x264 through mencoder, and then mux separately with mp4box.

As a developer of x264 (and avid user of flash for online video playback), I've had quite a bit of experience in this kind of stuff, so if you want more assistance I'm also available on Freenode IRC on #x264, #ffmpeg, and #mplayer.

Most encoders, by default (ffmpeg included) put the header atom of the mp4 (the "moov atom") at the end of the video, since they can't place the header until they're done encoding. However, in order for the file to start playback before its done downloading, the moov atom has to be moved to the front.

To do this, you have to (re)mux using mp4box (which does it by default) or use qt-faststart, a script for ffmpeg that simply moves the atom to the front. Its quite simple.

Note that for FLV, by default, ffmpeg will use the FLV1 video format, which is pretty terrible; its over a decade old by this point and its efficiency is rather awful given modern standards. You're much better off using a more modern format like H.264.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!