FLV to MP4 and FLV to 3GP using ffmpeg

roland's picture

I have a G1 phone and I like watching funny videos online. Here's what I did to covert flv files to mp4, which can be played by my phone.

In my ubuntu server, I installed yasm (from tar ball at http://www.tortall.net/projects/yasm/wiki/Download), x264, ffmpeg using the instructions from http://ubuntuforums.org/showthread.php?t=786095.

The ffmpeg manual is quite nice. http://linux.die.net/man/1/ffmpeg

To convert a file file from FLV to 3GP:

ffmpeg -i input.flv -s qcif -vcodec h263 -r 10 -b 180k -sameq -ab 64k -acodec libfaac -ac 1 -ar 22050 output.3gp

To convert a file from FLV to MP4:

ffmpeg -v 0 -i in.flv -y -acodec libfaac -ar 22050 -ab 64k -r 25 -vb 384000 -f mp4 -vcodec mpeg4 out.mp4

The problem with the G1 is that you have to download the videos first, then play them, you can't stream them. I use the meridian player, which doesn't seem to support streaming, and neither does the video player in the G1.