Washington Apple Pi

A Community of Apple iPad, iPhone and Mac Users

Putting video on devices using HandBrake

© 2010 Lawrence I. Charters

Washington Apple Pi Journal, reprint information

If you are like me, you are bummed at the prospect of taking a trans-continental flight, only to discover that the DVD disc showing how to use the new financial accounting system won’t work on your iPad. The iPad has neither a DVD drive, nor any means to attach one. So how will you ever learn the exciting details of assigning hours to correct accounting codes, or categorizing purchases according to the proper funding source?

Fortunately, there is a solution, a curiously named open-source software package called HandBrake. HandBrake does not directly install video on anything but, instead, extracts video from a DVD disc to a QuickTime or MPEG file on your computer which can, in turn, be transferred to your Apple TV, iPod, iPad, iPhone, MacBook Air or other device that doesn’t come with a DVD drive.*

To do this trick, you need the following:

Installing VLC media player

Installing VLC media player is easy. Download the image file, open it up, and drag the VLC application to your Applications directory. That’s it. While you can use VLC media player to watch various types of media files, including Windows media and QuickTime files, you never have to open it at all; it just has to be in your Applications folder. HandBrake uses code libraries from VLC media player, but you neither need to know how this works nor do anything to make it happen.

VLC icon

The icon for VLC media player. No, I don’t know why it looks like a traffic cone.

Installing HandBrake

As with VLC media player, installing HandBrake is easy. Download the image file, open it up, and drag HandBrake to your Applications directory. That’s it.

Handbrake icon

Handbrake’s icon has not been updated to handle the new 512 x 512 pixel size supported by Snow Leopard. And I can’t explain either the cocktail or the pineapple. However, you are asked to put down your cocktail when Handbrake is finished with a disc.

Finding an appropriate DVD

The next step is usually easy, but can be complicated: you need a DVD disc that your computer can read. Obviously, if your computer doesn’t have a DVD drive, you’re stuck. But even if you do have a DVD drive, not all DVD drives and not all DVD discs are equal.

Figure 1 shows a screen shot from an early model MacBook after a British-manufactured DVD disc is inserted. This warning screen states that the disc cannot be played on the MacBook unless the region encoding is switched from Region 1 (U.S. and Canada) to Region 2 (Europe and the Middle East). Such a switch can be done only four times, and then the MacBook will be permanently set to whatever region was the last choice.

Regional encodings warning

Figure 1: Many DVDs are “region encoded,” an attempt by manufacturers to control distribution and prices. If you attempt to play a DVD from a region other than what your Mac is set to accept, you get this warning message.

Newer Macs may never see such a warning, as many now ship with multi-region DVD drives. Such drives can read DVD discs from any region.

Launching HandBrake

Unless you’ve figured out how to stop it, a DVD-equipped Mac will launch the DVD Player application as soon as you insert a DVD disc. The first step in capturing the DVD disc, then, is: quit DVD Player.

The next step is to launch HandBrake. If a DVD disc is already in the drive, HandBrake will automatically open a window that lists all your disk drives on the left and, usually at the bottom of the list, any CD or DVD discs you have. In Figure 2, the disc “NOAA_AT_THE_POLES” is in the disc drive, so select that, as shown in Figure 3. Do not try and get strange and further select something inside the disc; just select the disc itself.

Volume listing

Figure 2: This Handbrake box pops up immediately after HandBrake is opened, showing you available volumes.

Select disc option

Figure 3: In this case, the volume “NOAA_AT_THE_POLES” has been selected as the target of HandBrake’s attentions.

After selecting the source disc, HandBrake will do a scan of the disc, looking over the content, and automatically select the longest piece of content for processing. A DVD can contain multiple video clips, including (on commercial video discs), previews of coming attractions, commercials about the video producer, and countless other bits and pieces of trivia. HandBrake assumes the longest piece is usually what you want to work with, but it isn’t always the case. At the top of Figure 4, under the icon bar, you will see a rollover menu called “Title” that allows you to select various clips on the disc, and pick one or more for processing. Note that the name of the saved video file is pre-entered in the Destination section; you will almost always want to rename the file, getting rid of underscores, surplus capital letters and other silliness.s

HandBrake main screen

Figure 4: HandBrake’s main screen shows controls across the top for selecting a video source, adding things to the queue and other actions. In the center are the settings selected for the video, including title, chapter or chapters, file name, file format, bitrate, codec, and many others.

Figure 4 also indicates that the Output Settings are set to Universal, which produces an MP4 file with an extension of .m4v. This is ideal –- but not automatic. However, with a little work, you can set HandBrake so that it always saves files in Universal format.

What is Universal and why should I care?

HandBrake is really the graphical front-end of a whole bunch of command-line utilities created (mostly) by Linux and Mac open source developers. By playing with the various settings, you can extract video clips from a DVD and save them in a wide variety of file formats, with a wide variety of file sizes, bitrates, audio characteristics, and even subtitles. To put it another way, you can fiddle with options and easily create a video file that can’t be read by your Mac, much less an iPod, iPad, iPhone or Apple TV.

For example, earlier versions of HandBrake allowed me to easily create video files that displayed fine on a Power Mac G5, but iTunes refused to even try and transfer them to an iPod touch or iPhone. Some that did transfer were marginal, and tended to “stall,” forcing you to watch the video in fits and spurts.

Fortunately, the HandBrake team has recently added the Universal preset which, in their words, provides “universally compatible, full resolution settings for all current Apple devices: iPod, iPhone, Apple TV, and Macs.” However, when you first launch HandBrake, it is set for Normal, which may be “normal” but which does not work on most things that you’d probably like to use for viewing video.

The default can be changed by, first, making sure you see the Presets drawer (found under the Windows menu, Figure 5), selecting Universal from the list (Figure 6), and finally, at the bottom of the Presets drawer, clicking the cog button and selecting Make Default. From that point on, when you launch HandBrake, it will use the Universal settings, and your iPad, iPod, iPhone and Apple TV can all load and play the same video file.

Window menu

Figure 5: The Windows menu in Handbrake allows you to reveal the Presets Drawer.

Universal selection

Figure 6: Unless you know exactly what you are doing, select Universal from the Presets Drawer. The cog icon at the bottom allows you to set Universal as the default.

Experimenting with Universal settings and comparing the result with video clips produced using much higher bitrates, it isn’t easy to see much qualitative difference. Stick with Universal unless you have lots of time on your hands.

Other Options

While there are a great many possible settings in HandBrake, the two most commonly useful ones are Add to Queue (shown at the top of Figure 4) and Subtitles. Many DVDs have multiple “titles” on them, which means multiple video clips. Confusingly, the “title” is really just the length of the clip in hours, minutes and seconds, so you can either save every clip or guess at what you think is important. Rather than saving each title separately to your disk drive, you can add them to the queue, then press the Start button to process them one after the other. Keep in mind that each title you save will need a different file name; if you fail to give five titles five different names, HandBrake will cheerfully process all five clips, and write each over the top of the previous one, leaving you with just the last file. You may say bad words.

HandBrake also allows you to add subtitles to the video clips, provided the original DVD has subtitles. I prefer to watch foreign language films with the original soundtrack, and pick up the narrative via the subtitles. HandBrake supports this quite nicely, but it doesn’t always work. No matter what options I tried, one video insists on playing the original soundtrack in Finnish, and the subtitles in Finnish as well. Similarly, a Japanese video has the original Japanese soundtrack, and Japanese subtitles.

If I seem obsessed with subtitles, it is a requirement for government Web sites to have subtitles for all video clips. Unfortunately, there is no consistency in how subtitles are added in video, so expect to spend some time experimenting.

Patience required

After making sure you have the settings you want, and the title or titles in the queue have unique names, press Start. HandBrake will read your DVD disc and slowly convert it to an MPEG file. The speed of this conversion depends on the speed of your Mac and the speed of your DVD drive. DVD drives in older model Macs were rated at 2X or 4X, while recent Mac Pros have had 16X and 18X drives. The faster the DVD drive and the faster the machine, the faster HandBrake can convert the video to a disk file.

The conversion from DVD to MPEG is complex, so it is best not to have other things running at the same time. In particular, the process of matching video frames to audio is sensitive to interruption; you will be very unhappy if the audio is distorted, or gradually falls farther and farther behind the video. While HandBrake is churning away, find something else to do.

The finished .m4v files can be imported into iTunes for playing on your Mac, or transferred, via iTunes, to your iPhone, iPod, iPad or Apple TV. You can even import the resulting files into iMovie or Final Cut for editing, allowing you to remove Aunt Midge’s annoying ex-boyfriend from all those wedding party videos.

In answer to a question you might have, no, I don’t know why it is called HandBrake. Some mysteries are destined to stay mysterious.

* Note: references to Apple TV in this article refer to the “old” Apple TV, the one with a hard drive, rather than the recently introduced video streaming appliance with the same name and completely different operation.

Resources

HandBrake, free
http://handbrake.fr/
VLC media player, free
http://www.videolan.org/vlc/