Please feel free to email me with any questions at with "blog" as the subject.

Search my blog:

Loading...

Thursday, 2 September 2010

Convert flv to mp4 video via ffmpeg

Quite often people download flash videos in FLV format from youtube or another site and then want to convert them to mp4 to put on an mp4 player or ipod.

It is quite simple to do in a GUI with a program such as k9copy but is a bit more difficult in the command line. Most other command line tutorials for this purpose need a custom version of ffmpeg compiled from source which can get messy.

If you have ffmpeg and all the common codecs installed then use the following:

bash$ ffmpeg -i input.FLV -acodec libfaac -ab 96k -ac 2 -vcodec libx264 -vpre hq -vpre ipod320 -threads 0 -crf 22 output.mp4

obviously replacing input.flv and output.mp4 with your filenames.

This is not very refined and I'm sure with some work more experienced linux users could change this to get better quality. however it does work for most.

If you don't have ffmpeg or any codecs installed then install them. Instructions are available in the wiki for your distro.