Convert AVI (or something else) to FLV

This entry was posted by on Thursday, 11 March, 2010

To convert a video to the Flash Video format, use the mencoder command like this:

mencoder <SOURCE_VIDEO> -o <OUTPUT_VIDEO>.flv -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3

Some (older?) versions of mencoder will require you to add the option -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames

This assumes you have the lamemp3 libs installed and that the output video rate shoud be 500k (good for web content). For better video quality increase the value at vbitrate=500 to something like 1000 or so.

This works fine on Ubuntu 7.04 (and probably any other system with mencoder installed).

On Fedora I use this command line to convert a HD video to 800×450 with good quality:

mencoder <SOURCE_VIDEO> -o <OUTPUT_VIDEO>.flv -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=5000:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=800:450


Leave a Reply