Tuesday, July 22, 2008

Watching DVD on your iPhone

So you have a bunch of DVD that you would like to be able to watch on the go, on your iPhone. In this little guide I'll present you HandBrake, a DVD converter for Mac OS X that will transform your DVD into a video that is playable on your iPhone.
But before we start, DVD ripping might be illegal in your country. Please check your local legislation before using Handbrake.

Handbrake is a free application for Mac and PC initiated by french developpers Eric Petit and Laurent Aimar. It is an Open Source project and the list of active developers is already pretty impressive. Looks good for the future of the app.



A quick glimpse at the presets will show you that handbrake support a wide variety of output devices. AppleTV, PS3, PSP, you name it. But we will focus on settings for the iPhone or iPod Touch.


When you insert a DVD a launch the app, it will analyse the disc to find the available audio tracks, subtitles, chapter layout, ect... And the great thing about Handbreak is that it will be able to export those informations to the iPhone video player.

So on the iPhone it is possible to switch languages.

...and choose a chapter.

And select subtitles...Just like a movie purchased on the iTunes Store.
The great thing is that you no longer have to re-buy a video on the store that you would already owned in DVD.

I'm not totally convinced by the "iPhone/iPod Touch" preset. It seems to be targeted to hight quality video in order to output on a TV with a video cable plugged on the iPhone. But I have the DVD for this, I more interested in adapting the video for playback on the iPhone, looking directly at the phone screen.

First, to save battery it is better to have a video resolution that matches the screen resolutions. It is Ok to have black stripes but if the iPhone has to scale the video it will consume more processing power either on the CPU or/and the graphic chip, and so drain power. Even if the iPhone has some hardware scaler support it might consume more if active, that's clearly not what you want in a mobile usage scenario.



The iPhone screen has a resolution of 480x320, pretty dense for such a small device. So if you want to be battery friendly try to choose an output resolution that matches it closely.

I've choose to use x264 encoding over regular MPEG4. The video quality/file size ratio is clearly better. Unfortunatelly the encoding process will be longer with this setting. I still need to do some testing to find out if H264 is battery friendly on the iPhone. I'll give an update on this blog as soon as I find out.

The default bitrate is clearly way too high for such a small resolution and will produce large files. Again on a 16 Go iPhone you may not want to spend 2 Go just for a single movie. Setting the bitrate to 350 seemed to be a good compromise between video quality and file size. I've choosed to allocate aproximativelly 4 Go for videos on my device, with a 350 bitrate, I can store about 8 movies on my phone. Just reduce the bitrate if you want smaller file size.

The encoding itself takes about an hour on my MacBook. Good news, Handbrake take advantage of a multi CPU machine.


On Mac OS X you can see the encoding progress on the Dock icon. A pretty nice detail.


No comments: