I recently bought an iPod Touch, very nice gadget, but with a very bad video section: only a few formats accepted, forcing me to recode almost all my video files.
I found the best way to do it on Linux is to use the Podencoder script by Mark Pilgrim. It mainly needs mencoder and mp4box, both easily installable on Ubuntu and Debian. The only problem is that my computer is really slow, and encoding an H.264 video seems to be never ending, also because the Podencoder script automatically use a Two Passes encoding, which gives the best quality, but also almost double the encoding time.
So I added an option to Podencoder to choose the Single Pass (the Two Passes is still the default action). If you want to encode using Single Pass just use the -1 option, like in this example:
podencoder -1 input_video.avi
You can download the modified script from here: podencoder.
Remember to make it executable. It’s also good to place is in the local bin path. To do all those actions just copy and paste the following lines into your terminal (you need to be root):
wget http://www.soccio.it/code/ipod/podencoder -O /usr/local/bin/podencoder
chmod +x /usr/local/bin/podencoder
If you are using Ubuntu or other sudo enabled distros, you can use these lines instead, without the need of being root:
sudo wget http://www.soccio.it/code/ipod/podencoder -O /usr/local/bin/podencoder
sudo chmod +x /usr/local/bin/podencoder
I also prepared a few lines script to encode your videos from the Nautilus file manager. The result videos will be placed into your Desktop. Just place the Nautilus Scripts Encode for iPod – Single Pass and Encode for iPod – Two Passes into ~/.gnome2/nautilus-scripts. Again: remember to make them executable. Again, to download and place the two Nautilus scripts in the right place just copy and paste the following lines into your terminal.
cd ~/.gnome2/nautilus-scripts/
wget "http://www.soccio.it/code/ipod/Encode for iPod - Two Passes"
wget "http://www.soccio.it/code/ipod/Encode for iPod - Single Pass"
chmod +x *
cd
linux