Most videos that I download from the net are in formats that the iPhone refuses to understand and play. I’ve tried searching online for utilities to convert videos for the iPhone, but it looks like almost all software available for this purpose online is either free or doesn’t do a good job. While freeware is almost non-existant (or of bad quality), a lot of shareware that is available insist on acting nasty and adding watermarks and other DRM to my videos.
I find this unacceptable and started looking online for some open source tools for this job and came across ffmpeg, which promises to solve all my problems.
FFmpeg is a complete solution to record, convert and stream audio and video. It supports more video and audio formats than most of us would care to remember.
The best part is that ffmpeg is cross platform and runs on almost all Unix like platforms (including Mac OS X) and Windows. It is bundled with almost all Linux distributions and for Mac OS X can be downloaded using the fink package manager and for windows is available from this link.
One problem with having such vast support for formats is the complexity it brings about. FFmpeg has hundreds of options to control almost every aspect of video and audio creation. And it’ll take a newbie ages to be able to read and even more time to understand those options.
After a lot of trial and errors, I think I’ve found the options that work for me and I’m sharing these in the hope that you guys will also find them useful.
ffmpeg -i INPUT_FILE -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -aic 2 -cmp 2 -subcmp 2 -s 320×180 -title “Some Title” OUTPUT_FILE.mp4
The input file can be in any of the formats that ffmpeg supports, which probably is more than you require. If in doubt, use ffmpeg is all that I can say.
The output file can be directly copied to the iPhone using itunes and should play on the device. The -s options specifies the dimensions of the file and the 320×240 means that the file will be optimized for display on the iPhone screen.