Hack 65. Convert Dual-Layer DVD to Single-Layer DVD
Use command-line and graphical tools to shrink a dual-layer DVD to fit on a single-layer disk.
It used to be that most DVD movies were released on 4.7 GB DVDs. If you wanted to create an archival copy, you could just do a direct copy of the DVD. Nowadays, many DVDs are released on a dual-layer disc (sometimes referred to as DVD9) that can store twice the amount of data as a single-layer disc (or DVD4). While dual-layer DVD burners are available, if you only have a single-layer model, you can't directly copy the DVD to a new disc. First, you must shrink down (requantize) the MPEG2 video so that it can fit on a 4.7 GB disc and then create a DVD based on the new video. DVD Shrink under Windows is a popular tool to use for this task, and while there isn't a feature-for-feature direct equivalent under Linux (apart from running DVD Shrink in Linux using WINE, which is a route some people take), there are some tools available that can at least help you shrink down the main title of a DVD to fit on a 4.7 GB DVD.
Most DVD-shrinking tools under Linux act as frontends for transcode and a number of other command-line video tools. This hack covers dvdshrink, batchrip.sh, and their graphical frontend, xDVDShrink, but you may also want to check out a totally different graphical tool called k9copy at http://k9copy.free.fr.
The first step is to download and install the complete set of dvdshrink tools. Go to the official project at http://dvdshrink.sourceforge.net, click on Download XDVDShrink, and then download the latest .tar.gz file from the download page. Next, extract the .tar.gz file, cd to the newly created dvdshrink directory, and run the install.sh script inside that directory as root:
greenfly@moses:~# tar xzvf dvdshrink-2.6.0-2mdk.tar.gz greenfly@moses:~# cd dvdshrink greenfly@moses:~/dvdshrink# ./install.sh DVDShrink installer v1.1 Checking for dependencies Installing DVDShrink… ------------------------------------ Removing old version from /usr/local/bin if it exists Creating application directories if needed Installing files Removing rc files if they exist Checking for perl-gtk2 Found! DVDShrink must be reconfigured the next time it's run
The install.sh script will check that you have all of the programs it depends on. These dependencies include transcode, mjpegtools, subtitleripper, mkisofs, dvdauthor, growisofs, gocr, and optionally Perl-GTK2 for the graphical frontend. The install script will tell you which programs you are missing so you can go grab the packages for your distribution.
The dvdshrink tools are split into three main programs, dvdshrink, batchrip. sh, and xdvdshrink.pl. dvdshrink is the command-line tool that shrinks a single DVD title, batchrip.sh can shrink multiple titles on a DVD into individual discs (useful for DVDs of TV series), and xdvdshrink.pl acts as a frontend for both. I generally recommend that you use xdvdshrink.pl if you can, since all the command-line options are accessible from there. That way you don't have to worry about remembering all the correct command-line arguments.
To start xdvdshrink.pl, type:
The first time you run the utility a configuration window will pop up. Here, you can tell dvdshrink where your DVD input device is located (usually /dev/ dvd), where your DVD writer is located (for many people this might be the same device), where dvdshrink will store files (pick a directory that has 10 to 15 GB of space), the speed of the DVD writer, which X terminal to use, as well as specify a number of other options. Save your configuration a single time and it will be available both for the graphical frontend and the command-line tools.
The main xDVDShrink window is split into two tabs. The Single Title tab acts as a frontend to the dvdshrink tool and will let you shrink a single title to a DVD. The Multiple Episodes tab is a frontend for the batchrip.sh tool and is intended for DVDs with multiple titles to rip, such as DVDs of a television series.
3.20.1. Shrink a Single Title
First, here's how to shrink a single title. In the main xDVDShrink window enter the name for your project. This is optional, but it helps keep things organized. Next enter which DVD title to rip. Often this is the first title on the DVD, but if you are unsure, click "Select from DVD" and choose the appropriate title (often the one with the longest run time in the case of movies) from the window that appears. Next choose which audio channel to rip. Usually the default is fine, but if you are unsure, click "Select from DVD" to be presented with the different audio channels the DVD has available. By default subtitles are not ripped, but you can change this from the main window.
With the main project configured, now you can configure the set of session options. The default behavior of dvdshrink is to shrink the title, create a new DVD filesystem, and then burn it to a blank DVD. However, you can change these session options (each of which correspond to a command-line argument) from the main window. Most of the options are self-explanatory, but some particularly useful options are "Save ISO with burn," which will not only burn the DVD but will also save a DVD image to your file system, so you can create more than one copy; "Create ISO file only"; and "Create MPEG files only". If you have different DVD-input and DVD-writing devices, you can enable the Force DVD burn option, and dvdshrink will automatically start writing to DVD when it is ready instead of prompting you. This way you can start the whole process and let it run unattended. You don't need to worry about conflicting options as the xDVDShrink program will disable any conflicting options for you.
3.20.2. Shrink Multiple Titles
To shrink multiple titles, click the Multiple Titles tab instead. Most of the options are the same as the Single Title tab except that you can set either a range of titles to rip or a custom list of comma-separated titles. You can also configure how many titles to fit on a new DVD; generally you would set this to the number of episodes that are currently on the larger DVD (the default is 3). Also notice that the number of session options is the same as with a single title, except that there are fewer options to choose from.
3.20.3. Start Copy Process
When all of the options have been configured, click the "Start copy" button. A new X terminal will appear and prompt you to press Enter, after which the shrinking process will begin. The terminal window will keep you up to date with what it is currently doing and how long each part of the process has taken. Here is some sample output from a test run against the Spiderman 2 DVD, where I told it to create an ISO only:
DVDShrink 2.6.0 - May 21, 2005 Rick Saunders (firstname.lastname@example.org) ______________________________________________________ INFORMATION Project: Spiderman2 File cleanup? No Auto-burn? No, ISO only. Save ISO with burn? No DVD Title: 1 Audio channel: 0 Subtitle channel: None PROGRESS Rip started at 12:32:55 DVDSHrink Function Status Elapsed Checking for A/V desynchronization Done! [00:00:23] Reading the chapter list Done! [00:00:23] Ripping Title Done! [00:16:00] Resizing MPEG2 video stream Done! [00:32:17] Remultiplexing Done! [00:45:17] Building DVD on drive Done! [00:54:33] Building TOC Done! [00:54:34] Creating ISO file Done! [01:02:55] Your DVD ISO (/home/greenfly/dvd/Spiderman2.iso) is ready! Thank you for using OzWare! Hit any key to close terminal and exit!
Notice that the entire process took about an hour on my 1.2 GHz machine with a DVD drive that can read at 8x. Each major step in the process took between 10 and 15 minutes. The total time will vary based on the speed of your DVD drive and the speed of your processor.