DVD Transcoding With HandBrake

In an earlier post, the Net Codger wanted to transcode a DVD for playback on a portable device. In this case the device in question was an iPod Touch. Having been unsuccessful at the task while using openSUSE 11.1, success was later found on another computer that was running Ubuntu 8.04. But, success was not immediate. Here’s what happened.

Initially, I tried using Mencoder for the transcoding. Mencoder is part of the Mplayer project and is one of the most versatile transcoding tools available for the Linux or any platform. Mencoder is the Swiss Army knife of video transcoding tools capable for transcoding almost any format into almost any other format. Like a Swiss Army knife it is also so chock full of features and tools that it is cumbersome and unwieldy to use. But, not only is Mencoder a really powerful tool it is also one of the few tools available for such a job, on Linux, that actually works. Which is why it was my first choice.

Like I said Mencoder is rather cumbersome to use. Typically, it requires a vast array of command line switches specifying frame rates and sizes, bit rates, sample rates, sound encoders and more to achieve the desired output. I’ve used Mencoder in the past for similar tasks including transcoding DVDs for playback on Sony’s PSP. e.g. This “simple” command for PSP transcoding.

mencoder dvd://1 -dvd-device /dev/sr0

-aspect 16:9

-alang en -oac lavc

-ovc lavc

-of lavf

-lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:vbitrate=384:acodec=aac:abitrate=64

-af lavcresample=24000 -vf harddup,scale=368:208

-lavfopts format=psp:i_certify_that_my_video_stream_does_not_use_b_frames

-ofps 30000/1001 -o M4V10005.MP4

-info name=”I Robot”

Simple, huh? But, not being an expert at video encoding or Mencoder I searched for a script or command line recipe for the iPod Touch transcoding job at hand. I finally settled upon this script at the My Humble Corner blog. The script was straightforward enough for me to read and understand while also promising the specific results required for the iPod Touch’s very specific playback requirements. These playback requirements include a special bunch of bits, called an atom, that are set in the .mp4 video file to indicate that the file came from iTunes/Quicktime and nowhere else. This is part of Apple’s continued attempts to lock in and impose DRM(Digitally Restricted Media) upon its customers. ‘You will use only Apple products! So says Steve, so say we all. Amen.’

Unlike my earlier openSUSE failures, this installation of Ubuntu 8.04 had no trouble playing and decoding DVDs but, it didn’t have Mencoder or the MP4Box application that the script required. A couple of quick and easy sudo apt-get install mencoder commands had me running the script in no time at all. While, the DVD was being transcoded and while I waited for the nearly four hours for it to complete I started contemplating the whole process. It was all too complicated and took too much time and effort. I remembered, with envy, all the accounts I had heard of Apple Mac users quickly and easily using a graphical tool called Handbrake to do all this. But, when last I had checked, Handbrake was Mac OS X only.

I started surfing around for a Linux equivalent, or at least a GUI front-end to Mencoder. What I found were a few stagnant open source projects that didn’t really offer too much hope. True they were GUI but, they weren’t very attractive, to say the least. Most were just as complicated to use as Mencoder itself, requiring detailed knowledge of video encoding and Mencoder. Then, by accident, I stumbled on a page that seemed to imply that HandBrake was now supporting Linux. I jumped over to the HandBrake site and was amazed to find that HandBrake now supported Linux and Windows, as well as the Mac.

Installing HandBrake on Ubuntu was easy since, they had an Ubuntu binary but, the source is also there for compilation if you need it. HandBrake also did not have as many dependencies as the other Mencoder solutions. Which was a pleasant surprise.

Running HandBrake, one is immediately aware of the fact that it has a superior quality GUI compared to the other contenders. It is attractive and highly functional while also being straightforward and intuitive enough for a transcoding novice to use.

HandBrake

After choosing the source DVD, the user is presented with this screen that lists various formatting details as well as a very handy list of formatting presets for a variety of devices including the iPod Touch. This list of presets alone sets HandBrake way ahead of the competition. HandBrake also displays a sample frame from the DVD to show you what the output video will look like. Very nice!

HandBrake Video

Choosing any of the tabs allows you to change various settings such as video, above, and H.264, below.

HandBrake H.264

But, HandBrake’s great features don’t end there. On top of everything else, HandBrake is also a fast transcoder. Where as the Mencoder script took nearly four hours to transcode the DVD, HandBrake transcoded the same DVD in under one hour!

It seems that the Mac users were right about HandBrake. HandBrake is, by far, the easiest to use, most attractive and fastest video transcoding solution I’ve used to date.

HandBrake is now Net Codger approved. Let’s hope that all the Linux distributions start including it in their repositories.