I’m close to my goal of being able to manage my iPod Touch completely without iTunes on Ubuntu. HandBrakeCLI (HandBrake’s command line interface) for Linux encodes excellent quality video, and although it runs in the terminal is simple to use.
Previously I was successful in converting DVDs for playback on my iPod using the HandBrakeGTK GUI, which doesn’t install in Ubuntu 8.04, has broken presets, and has now been abandoned.
I haven’t found a Ubuntu package for HandBrakeCLI, but this isn’t a problem as the program is a single executable file available from HandBrake’s downloads page. You can download and extract it yourself, or follow these instructions in the terminal:
- Download the latest version of HandBrakeCLI for Linux. This command will download and extract version 0.9.2 (the latest as I write this):
wget -O - http://handbrake.fr/rotation.php?file=HandBrake-0.9.2_i386.tar.gz | tar xz -C ~ - Mark the file as executable:
chmod +x ~/HandBrakeCLI - Move the HandBrakeCLI executable to /usr/bin to install it (will ask for your password):
sudo mv ~/HandBrakeCLI /usr/bin
Now you should be able to run HandBrakeCLI system-wide.
Before you can convert a DVD, first you need to be able to play it. If the DVD is encrypted and you haven’t set up playback of encrypted DVDs in Ubuntu, see my post on this topic before proceeding.
HandBrakeCLI’s presets mean it’s pretty simple to create a video that will play on the iPod Touch/iPhone. Here’s the most basic command:
HandBrakeCLI -i /media/cdrom -o mymovie.mp4 --preset="iPhone / iPod Touch"
And here’s an explanation of what’s going on:
-i /media/cdromSelects the input source, in most cases this will be your disk drive.-o mymovie.mp4The output file.--preset="iPhone / iPod Touch"The preset to use, see this wiki page for more presets.
This is my preferred command at the moment:
HandBrakeCLI -i /media/cdrom -o mymovie.mp4 --preset="iPhone / iPod Touch" --longest -b 256
Here I have added a more few options: longest to make sure the longest segment of video is the one I am encoding, markers to make it so I can browse chapters on my iPod (doesn’t seem to work) ([update] markers are included in the preset), and b 256 to override the bit-rate to a much lower value. These settings result in reasonable quality and shrink a two and three quarter hour movie to under half a gigabyte.
Once you let HandBrake go, it should work until you see the Rip done! message. This will take some time depending on your CPU (multi-cores are used) and DVD drive speed.
The HandBrake wiki has a good page with more information about the CLI:
http://trac.handbrake.fr/wiki/CLIGuide
If you haven’t got your iPhone/iPod Touch syncing in Linux, I’ve got a post for this. Want to encode non-DVD video for your iPhone? I’ve got a guide for this as well.


You don’t need to include the markers option, it’s included in the preset.
From what I’ve seen, you need to use the .M4V file extension for the chapters to work correctly. Just change the extension from .MP4 to .M4V and it should work.
Anonymous:
Thanks for pointing that out, I’ll remove the redundant markers option from my command.
Anonymous:
I’ve tried that already, I suspect now that it’s a problem with the video’s tags.
[...] Convert DVDs for iPhone or iPod Touch with HandBrakeCLI – via Tombuntu. This one is specifically for gilmae. Share this:Close this WindowBookmark and Share This Page Save to Browser FavoritesAskbackflipblinklistBlogBookmarkBloglinesBlogMarksBlogsvineBUMPzee!CiteULikeco.mmentsConnoteadel.icio.usDotNetKicksDiggdiigodropjack.comdzoneFacebookFarkFavesFeed Me LinksFriendsitefolkd.comFurlGoogleHuggJeqqKaboodlelinkaGoGoLinksMarkerMa.gnoliaMister WongMixxMySpaceMyWebNetvouzNewsvinePlugIMpopcurrentPropellerRedditRojoSegnaloShoutwireSimpysk*rtSlashdotSphereSphinnSpurl.netSquidooStumbleUponTechnoratiThisNextWebrideWindows LiveYahoo!Email This to a FriendCopy HTML: If you like this then please subscribe to the RSS feed or Email feed.Powered by Bookmarkify™ More »Related Posts12/5/2008 — XBox360 as a PVR with (Ubuntu) Linux (1)9/5/2008 — Nautilus Scripts to mount .iso images in Ubuntu (0)14/5/2008 — Ubuntu Firewall – ufw (0)14/5/2008 — Linux References (0)12/5/2008 — Something to do… (0) [...]
[...] Convert DVDs for iPhone or iPod Touch with HandBrakeCLI By Tom I’m close to my goal of being able to manage my iPod Touch completely without iTunes on Ubuntu. HandBrakeCLI (HandBrake’s command line interface) for Linux encodes excellent quality video, and although it runs in the terminal is simple … Tombuntu – http://tombuntu.com [...]
[...] Play DVDs on your iPod and iTouch Filed under: Hardware, Linux, OSX — 0ddn1x @ 2008-05-17 16:12:18 +0000 http://tombuntu.com/index.php/2008/05/14/convert-dvds-for-iphone-or-ipod-touch-with-handbrakecli/ [...]