Last update on .

Background

My family invested in the complete set of the Avatar cartoon series (both the Last Airbender / Legend of Aang and the Legend of Korra season 1). If you haven't seen the series, I highly recommend you watch it; it is a masterpiece in nearly every way.

I don't often buy DVD's because the encryption is so infuriating. I can't even give my money to the decent companies because there is no indication on the box about how annoying it will be to use the content. BlueRay is even worse, and don't even get me started on the problems with online services like Amazon and Vudu that pretend that you are purchasing content when in reality you are only renting (I don't mind true rental services like Netflix and Hulu). I have small children who destroy things like DVD media, so if I can't backup a disk it isn't worth buying. Further, there is little point in purchasing a movie that can't be viewed on a mobile device that doesn't have a DVD drive.

Every disk of the Avatar Series is corrupted in a slightly different way.  In my effort to backup these DVDs I found that there are lots of instructions for Windows users, but not much current information for Linux people. This post will hopefully help you to consume your legal content.

A quick note: if you are reading this post to learn how to copy a DVD that you borrowed or rented from a service like RedBox, please stop being a jerk. You are the excuse the media companies use to make our lives miserable. Please only copy media that you own.

There are a few different ways that DVD authors make their content a pain to use. I'll provide a brief description of the main roadblocks and suggest tools for dealing with them. I will describe the use of the tools in more detail when I describe the process I use for backing up a DVD.

Copy Protection Strategies

Region Coding Enhancement

RCE is a frustrating system that movie studios use to charge consumers in different places different prices for the same content. DVD players have a region assigned to them, and they are expected to only play content with that same region code. The region code is specified on the packaging for the DVD. Most computer DVD players ship without a code assigned, and many modern DVD players ignore the region code (some of these players advertise themselves as being "region free").

The region code is unlikely to be the problem with you accessing a DVD. If you bought the DVD in your geographic area, then it probably already matches the device you are using to read it. If you see an error like "Suspected RCE Region Protection", it is unlikely to be the real problem and is probably masking something else. If you are unsure, then you should confirm that your DVD player is set to the region of the media you are trying to read. Be aware that DVD firmware only allows the region code to be changed about a half-dozen times before it is permanently locked to a specific region.

On Linux you can query the code and set the code using the utility regionset.

Content Scramble System

CSS is a type of encryption used to make DVDs unreadable by unlicensed players. The encryption was broken in 1999 (it is an instructive story with the resolution summarized here). To access an encrypted DVD on Linux, you need to have DeCSS installed. The RPM for Fedora 20 is named libdvdcss RPM, and I believe the most reputable source is from Livna. I believe it is safe to add the Livna repository to your yum sources as it should not conflict with standard Fedora packages or rpmfusion. I am able to read the vast majority of DVDs with libdvdcss, but a few were only readable by extracting the MKVs using MakeMKV. I suspect the problem is that a bad sector scheme is preventing the CSS decryption.

Bad Sectors

Copy protection systems such as Advanced Regional Copy Control Operating Solution (Sony ARccOS) attempt to prevent the copy of DVDs by intentionally introducing bad sectors in areas that are not normally accessed by DVD players.

This post suggests using ddrescue to copy the DVD without bad sectors, and then use dvdbackup to extract the MKV files from the ISO produced by ddrescue. I gave it a shot on the DVDs that were not working for me, but I didn't see results that were any better than directly ripping with HandBrake--either way resulted in a crash in libdvdread. MakeMKV appeared to handle these DVDs fine.

Bogus Titles

DVD authors also introduce bogus titles in an attempt to ruin your extraction of the content. The Lord of the Rings DVDs are a bad offender in this way. Though each DVD has only a few titles in the menu (theatrical release, extended edition, and special features), the DVD lists dozens of titles. Some have the correct length, but have the scenes in the wrong order. Some claim to be the correct length, but actually produce files that end early.  Some are meant to crash your player.

You can usually get the correct title by using the longest one with a reasonable length, but you should check for content being out of order in the middle. The best strategy is to open the DVD in a media player (like Dragon or SMPlayer), select the title you want to copy, and as it starts playing the media player will usually show the DVD title number that you should rip.

The Process

Because of all of these roadblocks, the process to complete a backup varies based on the specific DVD. This description includes all the steps I use and which tools I find useful, but often steps can be skipped depending on your desired outcome.

Read the DVD

Reading the DVD includes breaking the encryption. Most DVDs can simply be read using the KDE Dragon player to load the disk. If Dragon player has problems (such as garbled sound when reading an MKV), I use SMPlayer or call MPlayer directly.

RIP the Files

If you can read the DVD, you can probably copy it directly with a burning utility. My favorite is K3b. I find that the default settings work well in almost all cases.

Some DVDs can not be directly copied. This is when I use MakeMKV to extract the DVD data as unencrypted MKV files. These MKV files are a little smaller than the DVDs native VOB files, but do not alter the compressed video so no data is being lost. They are easy to read, repackage as a VOB, or re-encode. MakeMKV is a closed-source application that labeled as being in beta, is currently free, and does not look like it has been updated in a few years. Though the download link doesn't list it, a Linux native version is available in the forums. Building it from source was not very hard, but I did have to pass a prefix to the configure script so that it would install into /usr/local instead of scattering itself all over my filesystem. It works fine on Fedora 20.

Once the VOB or MKV files are on your hard drive, it might be worth editing the DVD before burning a copy. DVDs often contain a lot of data that you don't care about. It is often easy to fit a 9GB source DVD into a cheaper 5GB DVD, and I often combine multiple DVDs into a single disk for my family (the 5 disk seasons for Avatar easily fit onto 2 9GB DVDs). This is done by viewing the files on your hard disk and discarding the menu, special features, bogus titles, and copies of titles (utilities like MakeMKV and dvd95 will do this for you). You would then need to re-master the DVD with a simple menu.

While you are at it, you might as well also get the DVD to a format that can be used on a portable device. This will require transcoding the MKV or VOB files into another format such as MP4 (m4v). You want to minimize the number of times you transcode a file, as you will lose a bit of data each time you make a lossy transcoding.

Handbrake is a versatile DVD rip utility and video transcoder. The Fedora package using Yum is "HandBrake-gui" (notice the capitals). If the menu entry doesn't show up, the command to launch it is ghb. I like to encode everything using the built-in profile labeled "Regular -> High Profile", which makes a good trade-off between space and quality such that the files are usually small enough for a mobile device, but the video looks pretty good on a big screen. The resulting video is not DVD quality (about the same drop in quality from a DVD as can been seen between a DVD and a BlueRay), but the video take far less space than a DVD (about 10% as big). For a large movie I might save even more space by doing a second copy for my phone using the "Regular -> Normal" profile or the profile for the specific device on which I will play the movie.

Master a New DVD

If you edited the DVD image, then you need to master it into a new DVD. DVDStyler is a reliable and easy to use open source tool for this. It makes it easy to add menus with the various titles and then it will generate an ISO image file for testing (it can even burn it to disk for you).

To get the best quality, it is best to add the extracted VOB or MKV files to the DVD project. DVDStyler will detect when there is too much original data to fit on the new DVD, and re-encode the video at the best quality that will fit. If you add MKV files from MakeMKV and there is enough space, it will repackage them as VOBs without any re-encoding. If you add converted m4a files from HandBrake, then you will see a drop in video quality. Be aware that creating a DVD that requires a lot of video re-encoding can take multiple hours.

Burn the DVD Image

Once you have an ISO that contains the content you are copying, I suggest testing it in Dragon Player in order to verify that it works and there are no mistakes. I frequently find that I added a video twice, or mislabeled something, and am glad to fix it before I wast a DVD.

Be sure to burn the ISO image directly to the disk, instead of adding it as a file to a data DVD. K3b detects that you are trying to burn an ISO, and manages the process well with its default settings.

Notes

A few other things I discovered in this process:

  • There is a package called libdvdcss2 that some say is useful in reading some troublesome DVDs. For Fedora 20, it seems like the best place to get the RPM is from ATRPMS.net, but I am nervous about package conflicts so I did not add it as a yum repository but instead downloaded the RPM and installed with yum localinstall. The package did not appear to help me read the DVDs I was struggling with, so it might not be useful for you.
  • The current packages for dvdread and dvdnav in Fedora 20 are 4.2.0, but 4.2.1 was recently released. I built a new RPM using the spec and patch file extracted from the 4.2.0 source RPM, but it did not help me read the DVDs that were giving me trouble. It appears that 4.2.1 is now available from the package database.
  • I also tried dvdbackup, dvd::rip, dvd95, and k9copy. None of them could read my troublesome DVDs. Some of these utilities are no longer maintained.
  • ddrescue did not appear to help.
  • There are other copy protection schemes for DVDs listed on this Wikipedia page, but either I have never come across them, or MakeMKV addressed them.
  • Building MakeMKV version 1.8.7 involves two components, makemkv-oss and makemkv-bin. Building and installing makemkv-oss takes three commands: ./configure --prefix=/usr/local, make, and make install. Building and installing makemkv-bin required me to edit the DESTDIR variable of the makefile to point to /usr/local before running make install. make install requires root privileges to update the linker cache to point to /usr/local/lib or the application will not be able to locate its libraries when you run it, or you can edit /etc/ld.so.conf to list that directory.

The summary is that if I can't rip directly from Handbrake or make a direct copy with K3b, I just use MakeMKV.

If for some reason MakeMKV does not work for you, the next option is to use a Windows utility through Wine. It looks like a few work well, and the only trick is getting Wine to reliably detect your DVD drive. You can also load a Windows virtual machine. I am grateful that MakeMKV worked so well I didn't need to explore these options in detail.

Conclusion

After reading all of this, it would be logical to conclude that it is far easier to just download a pirated version of the media. To be honest, whoever prepares a download will likely did a better job than you will be able to. It seems to me that sometimes downloading a pirated version is the only option for accessing content you legally purchased. I recommend that you still buy the DVD, though I can sympathize with the feeling that the movie studios don't deserve the money that they receive.

I hope that the movie studios realize that they shouldn't punish their paying customers. One day they will be drive to adopt DRM free electronic media like the recording industry eventually did. Such an action would lead me to spend more money on their content, as currently I usually decide not to make a purchase when I consider how much of a pain it will be to backup the media or copy it to a device where it is usable.

Pingbacks

Pingbacks are closed.

Comments

  1. Alex Evans

    Alex Evans on #

    Loved the post Richard, I've conquered encrypted BluRays and DVDs on Windows myself, makeMKV, dvd decryptor, handbrake and dvdshrink are favorites of mine on there. Though the problem is that a lot of times these developers making the programs get cease and desist letters from the movie makers and development disappears, and the movie companies come up with something new. It is quite a shame that pirating a movie is better than buying a DVD, being forced to navigate silly menus, sit through 5 minutes of anti-piracy propaganda & previews...and only after that can you watch the movie you paid for. Glad you made a set of instructions for Linux, that will be immensely helpful for a lot of people.

  2. Richard Esplin

    Richard Esplin on #

    Thanks for your comment Alex!

    Since publishing this article, I found this great Fedora yum repository that contains most of the software mentioned in this post that is not in the official repos or RPM Fusion.

    http://negativo17.org/repos/HandBrake/fedora-$releasever/$basearch/

    The author appears to work with the RPM Fusion team, and has been cautious to keep his packages compatible with Fedora and RPM Fusion,

    More information here:

    http://negativo17.org/

Comments are closed.