Anyway I wanted to see if I could watch Battlestar Galactica on my phone while on the bus to work each morning and found that it's not that difficult with Free open source software. My Battlestar Galactica episodes in .avi format, so I just needed a way to convert my .avi file to .3pg. Then put that newly created .3pg file on my microSD card and fire up my media player on my phone and I should be good to go. Here is how I did it.
Install the following: ffmpeg, amrnb, amrwb and sox. In debian based distros it's pretty straight forward with apt-get and each of these applications are in the Ubuntu repos. Then issue the follow command:
ffmpeg -i inputfile.avi -s qcif -vcodec h263 -acodec aac -ac 1 -ar 44100 -r 25 -ab 192 -y outputfile.3gpHere is a brief breakdown of the ffmpeg command. You can find more detail on the ffmpeg man page.
-i input file
-s video size (qcif=176x144, see man page)
-vcodec video codec (needed for the conversion)
-acodec audio codec
-ac # if audio channels
-ar Audio frequency
-r Frame rate
-ab audio bitrate
-y output file
You may have to fiddle with the frame rate a bit to what works best for you on your device. I've converted one file and played it on 2 different devices and the audio and video sync was off on one and not the other, which tells me that something funky is going on with different media players. I would recommend that you keep the audio quality (freq and bitrate) high because the speakers on most of these low quality device are pretty crappy. You will want to have goo sound quality if you expect to hear anything.
A one hr long episode of Battlestar Galatica in .avi is about 350 mb, once converted to .3pg with the above configuration rates is about 80 mb.
If you have mpeg files you would like to convert, use the following:
ffmpeg -i inputfile.mpg -s qcif -vcodec h263 -acodec aac -ac 1 -ar 8000 -r 25 -ab 32 -y outputfile.3gpIf you're try to get videos off your phone to watch on your computer, here convert your files the other way.
ffmpeg -i clip.3gp -f avi -vcodec xvid -acodec mp3 -ar 22050 file.aviEnjoy!