Posts Tagged ipod

Converting an AVI to an MP4 to play on your phone/ipod/whatever

I’m sure there are millions of ways of doing it, but this is the way I use. YMMV

  1. On Windows, download The Unofficial FFmpeg Win32 build. It’s a .tar.bz2, so you’ll probably need Winrar to extract it.
    On linux simply apt-get/yum install ffmpeg, whatever is appropriate for your distro.
  2. Use the following command line to convert the avi to a mp4:
    ffmpeg -i INFILE.AVI -acodec libfaac -ab 32kb -ar 32000 -ac 1 -vcodec mpeg4 -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x240 -r 12.5 -qscale 8 OUTFILE.MP4
    • -s is the resolution (320×240 here, coz that’s the screen size of my phone),
    • -r is the framerate (12.5 fps here),
    • audio is encoded at 32kbps 32kHz mono aac,
    • video is endcoded at around 175kbps mpeg4 (h263+). The video bitrate is controlled by the qscale value: lower qscale => larger file + better quality, values of 6 or 8 are common. Valid range is 2-31.
  3. That’s it! The OUTFILE.MP4 will now play on your phone/ipod/whatever. A 45min episode of Heroes in a 50MB file.

As stated above, it works for me. It may not work for you. :)

, , , ,

1 Comment

css.php