December 23, 2007

Encoding iPod Video

You never know how many times I tried to encode videos for my iPod and could not quite figure out how things work. Oh yes, I know there are a lot of tools available for Windows (although most of them are commercial software). On Linux, I was pretty sure it was possible to encode and transfer movies to my video iPod. But oh man, it was hard to actually figure out the tools to use and the options I had to choose for getting an iPod-friendly video. Several times I tried installing ffmpeg, building it from source, installing other libraries that ffmpeg depends on, blindly following directions from forums, etc. But the result was the same: I could not invoke ffmpeg successfully to get an iPod-friendly video. It always complained about some incorrect command-line option, or missing component, or something else which I couldn't fix. Today I finally found the tool that can convert give me iPod videos! I have been using Avidemux for quite some time to do some video editing, without ever realising that Avidemux can write MP4 files that iPods like. Here is the configuration for output video:
  • Choose Mpeg4 (lavc) as the video codec.
  • Click Filters button and change the video size to 320x240. If your source video is not compatible with this size, resizing will result in skew/stretch of the video. You may add some black borders to make the size, a multiple of 320x240. For example, I added 96 pixels on top and bottom to make a 640x288 video to 640x480. Then resizing it to 320x240 will not change the aspect ratio of the video.
  • Choose FAAC as the audio codec. Click on Filters and choose Stereo for Mixer option.
  • You can change audio bitrate by clicking on Configure button.
  • Choose MP4 as the video format.
And that's about it. Choose Save > Save Video... from File menu to get your video :-) Edit: Added the mention of Stereo type for audio. Otherwise iPod won't play the audio if your source audio has more than 2 channels. Also removed the step of setting video bitrate, which is not quite necessary.

1 comment:

  1. This was SO helpful, just what I was looking for. Thanks a lot

    ReplyDelete