Movies for Mobile Phones / iPods

Want to watch your favourite movies on your iPod or mobile phone ? (Great for long journeys) And are you a Linux user ? Read on.

(Windows / Mac users might as well use the software that comes with the mobile phone / iPod)

Most of the phones / iPods play videos in MPEG – 4 format and sounds in AAC format. So, all we we need to do is to convert a video into MPEG – 4 with sound encoded as AAC.

Step 1: Get ffmpeg code

According to the ffmpeg project website, “SVN snapshots work really well 99% of the time so people are not afraid to use them”. So, we checkout their SVN repository

$ svn checkout svn:// ffmpeg

Step 2: Compile

Before compiling, we need to set proper compile options.

$ cd ffmpeg/
$ ./configure --enable-gpl --enable-pthreads --enable-libvorbis --enable-liba52 --enable-libgsm --disable-debug --enable-shared --enable-libfaac --prefix=/usr/local

Now, compile

$ make
$ sudo make install

Step 3: Convert

Convert the video file of your choice to the MPEG -4 / AAC format.

$ ffpeg -i some_video.avi -s 320x240 -ab 32000 -b 64000 output.mp4

  • 320×240 is the screen size for my mobile phone (Nokia 6233) and for a standard iPod (I think)
  • -ab 32000 signifies the the output audio bitrate.(32 kbits/s)
  • -b 64000 signifies the output video bitrate (64 kbits/s)

You can experiment with the two features above. I found these to be the ideal values, the opposing factors being quality and file size.

You can use the following command for a Widescreen format movie. (16:9 types)

$ ffpeg -i some_video.avi -s 320x180 -padtop 30 -padbottom 30 -ab 32000 -b 64000 output.mp4

Suppose the audio doesn’t get encoded in AAC format by default, one can also try adding the option -acodec libfaac or -acodec aac.

Step 4: Transfer

Transfer the the output video to your phone / iPod and enjoy!