Sunday, July 26, 2009

DVD Backup on Leopard (Mac OS X 10.5.7) with FairMount, VLC, and Apple's Disk Utility

So, let's say you have a legally purchased DVD you want to back up to a DVD+R DL. What's the best way to do it?

You can do it with a commercial tool, but a little bird told me that the cool Mac kids are using VLC and FairMount, which smears cream cheese on your DVD, or something. Wot?

Well, actually what it does is mount the disc as another virtual volume, which is decrypted on the fly by VLC, so that you can back it up.

Note that this (the "backing up," no the decrypting on the fly) may be technically illegal. There is a "fair use" exemption to copyright that should, in some sense, apply here, but I've also heard that copying a protected DVD was made explicitly illegal as part of the DMCA. I feel it is ethical to back up a disc which I paid for, especially with a house full of small children who can destroy a DVD in seconds flat, but the legal arguments are far too complicated for me to fully compile -- or even parse -- so I'll leave that to you.

In this post I showed one technique I had worked out for creating a backup of an unprotected video DVD that would then play on a home DVD player.

The situation with commercial encrypted DVDs is more complicated, but VLC 1.0 and Fairmount 1.0.4 seem to make it a lot less complicated.

I don't need to run VLC -- I just need to have it installed. I put in my commercial (encrypted) DVD, and then run FairMount. FairMount will unmount the original disc and mount a "fair" virtual disc that decrypts itself on the fly as you read it. I think it uses a library from VLC to do this. If Apple's DVD Player program started automatically when I put the DVD in, I quit it.

To just back up the DVD to video files that will play on the computer, I could just drag-copy the Fairmount-mounted volume to a folder on my hard drive. But what I want instead is an image file that I can use to burn a DVD+R DL -- with a correctly laid out UDF file system -- that my appliance DVD player can play.

I have a fresh stack of Verbatim 2.4x, just ready and waiting to turn into coasters -- let's go!

In my previous article, I described how I was unable to do something similar, using unencrypted content, with Disk Utility. But that was with a previous version of MacOS X. Disk Utility is, largely, a GUI wrapper on top of several Apple-supplied command-line tools. If it won't drive the command-line tools the way I want it to, I ought to be able to drop down and do it directly. But first, let's see if I can do it from the GUI, which many users might find easier.

When I run Disk Utility, I can see the mounted DVD twice: the DVD in the drive, and the virtual file system provided by Fairmount and VLC. I can just select the virtual file system, and make a new image. The format I want is "DVD/CD master." This ripping will take a while. Even though this machine has 8 cores, the DVD drive can only pull data off the spinning disc so fast. The bottleneck is the drive, not the processors. So, I'll be back after a cup of coffee.

Well, there was no coffee made so I had a wee dram of Lagavulin instead, and watched part of a video on mathematicians who went insane. But now I've got a .cdr file created by Disk Utility. I can mount it in the Finder as if it were a read DVD.

If I select the mounted volume and chose "Get Info," I see that it is a UDF (not HFS) file system, which is a good sign. I ought to be able to eject the decrypted volume provided by Fairmount and VLC, and the original DVD, and still play the new image using Apple's DVD player, using the "Open DVD Media..." menu item.

That works. This normally requires encryption keys that are on the original DVD's lead-in area, and it isn't present anymore, so this tells me the video in the image file has been successfully decrypted, and the DVD's data stored not just to a set of files, but to a mountable image file.

So now let's see if I can burn it for my home DVD player. The burning process has to produce a contiguous file system on the DVD media, since home "appliance" players need the data to be optimized in this way. I quit DVD player, open up Disk Utility, hit the "Burn" button, and tell it where the .cdr file is. I put in one of my DVD-R DL discs. It reads the disc to figure out what it can do with it. For the sake of reliability, I tell it to burn at 2.4x, and ask it to verify and eject. This also will take a while; at least an hour, so I'll be back after an errand!

OK -- errand run, and I've got my burned DVD-R DL; it passed verification and it mounts on my Mac. "Get Info" shows it to be of file system type UDF, and the Apple DVD player application plays it. But will my Sony DVD player play it? (One moment please...)

The answer: yes, it appears to work fine. Navigation, chapters, special features: all there! That's a lot easier than it was last time; no need to mess with DarwinPorts or fink or extracting a binary tool from an application. It just works! [FOOTNOTE 1]

Note that this technique won't let you put a commercial double-layer DVD onto a single-layer DVD-R. That ought to be obvious, but I just thought I should mention it. There are commercial tools (DVDRemaster, for example) which can do this, but they require re-encoding the files into smaller files and so the result is not a perfect copy of the original.

[FOOTNOTE 1] I made backups of 3 commercial DVDs. All of them passed verification on my Mac. On the Sony appliance DVD player, though, one of them seems to work perfectly, one freezes after the menu, and one has a single glitch that causes the video to freeze for a moment and the playback to skip forward ten seconds (although if you carefully back up nine seconds, you can see most of what it skips).

A fresh copy of the disc with the minor glitch worked fine. It seems that the Mac's SuperDrive is better at reading DVD+R DL discs than the Sony appliance player is. That's no great surprise, especially given that the Sony is seven or eight years old. It also seems that DVD+R DL media is just a little bit tetchier than pressed commercial discs. It is after all quite a complex technology, and relatively new; I burned a lot of coasters on one of the first available consumer CD-R drives, back when they were new. DVD+R DL discs are semi-transparent: the laser has to be able to focus and write on two different planes of dye material -- in other words, it has to be able to shine through the first layer without writing it to focus on the second layer. I'm still slightly amazed that they work at all.

For the other disc, the one that wouldn't play at all, a new copy from the image file didn't work either. It seems I must have done something wrong -- perhaps I didn't specify the correct image type? So I ripped a fresh image file tried again, following my own instructions. It worked, which means I burned three usable discs and two coasters out of five tries. Not great, but it could have been worse!

No comments: