My first consideration is the cost in money. CD writers have been around a while, and both the drives and the media are fairly cheap. But if you want to backup an entire movie with a CD writer there are some trade offs. Either you end up with multiple CD's or unsatisfactory quality. The good news is that DVD burners and media have come down in price as well, and are just now becoming a viable option. 100 1X DVD blanks now cost less than $70 US and the Pioneer DVR-104 drives are now going for less than $100 US on Ebay. Right, a DVD writer it is then.
The next major issue is a matter of formats. The DVD standard is a pretty loose standard. First of all there are currently about 18 different physical varieties with capacities ranging from 1.36 Gig to 15.90 Gig with more on the way. By far the most common formats, thankfully, are known as DVD-5 (4.37 Gig) and DVD-9 (7.95 Gig). Now, guess which format commercial DVD's come in, and which format your typical DVD writer writes? That's right, most commercial DVD's are DVD-9 and most DVD writers are DVD-5. So many DVD's have to go through a process known as transcoding to shrink them down to fit on a DVD-5 DVD. Unless, of course, your source DVD happens to be a DVD-5 format DVD or else you don't mind splitting the content roughly in half.
In addition to the different physical varieties there are also different logical format varieties. There are various audio, video, menu, subtitle, and other possibilities. For example, one or more audio tracks in AC3, MP2, or WAV formats are allowed. The Linux based tools for manipulating DVD data are fairly well advanced. The problem is that, since DVD writers have only recently become an option for the average joe, the tools to burn DVD's are not as well advanced. In fact I found it a bit of a challenge to generate a script that could reliably produce a DVD that would play in most set top DVD players.
What I wanted was a simple Perl script where I could pop in a DVD, run the script with no special options, and come back a while later with a burnable DVD-R ISO image. I have found that after a lot of work, I have something that is almost there. The ISO image almost always comes out fine, but I at least need to verify the image before I burn it.
The first thing the script does is check for cached information about the DVD, and generates it if it doesn't exist. Then it copies the titles requested by the user (by default all of them) to the vob directory. The selected titles are transcoded chapter by chapter and a valid DVD structure is created from the specially formatted video, and an ISO image is created. If something goes wrong at any step of the process the script exits cleanly and you can recover from that point after you fix the problem so that no time is lost. Two logs are produced, one for the commands and thier output, and one to chronicle general progress.
If the user has selected to split the DVD (using the -s option) the titles are copied directly and an image is created as long as at least one title will fit. When splitting the options -f, -a, -b, -z, and -v options are ignored. The -x option causes the script to create a duplicate of the source DVD which is a good idea only if you know the source DVD is in DVD-5 format. When duplicating most options are ignored.
There are some problems of course, especially with the transcoding process. I think the biggest problem is that it takes a lot of time and HD space. On my (PIII 866) system it takes about 20 hours to transcode a typical movie, as well as 20 Gigs of HD space. There are some options, defined below, that will reduce that to about 10 Gigs, but then you can't recover if something goes wrong. The other big problem is that occasionally the A/V sync for individual chapters is off. So when I have to transcode a DVD I preview each chapter and verify the sync is good before I burn a coaster. If the sync is off then I either delete the offending output vob file(s) in the out directory and rerun the script with a fudge factor or else (especially for the extra content) rerun the script with the -t option to skip the offending titles. If I am really feeling adventurous I use -- to override the transcoding options. Finally, when transocding you are currently limitied to one audio and one video rack, and no subtitles.
There are three major issues that aren't related to transcoding. One is that that there is no support for menus. The second is that to use this script to split a DVD by chapter instead of title you need to run it once (using -k would be a good idea here), edit the info.dvd file to include a bogus new title, and rename some files in the vob directory. The first problem really doesn't bother me, and the need for splitting up a DVD by chapter occurs so infrequently for me that it is not worth my time to do anything about it. The final and most severe problem is that I have been unable to get both dvdbackup and tccat to reliably split a DVD up by title or chapter. If you know of any other Linux programs that do this PLEASE let me know. dvdbackup occasionally results in missing or extra video in the middle of a chapter, while tccat either results in unusable streams (-T), or wants to give me the whole titleset (-P). Until this problem is resolved I can not reccommend using the -p option.
I rarely use any options other than -t, -v, and -c. Some example usages are:
| Option | Value | Description | Comment | Default |
|---|---|---|---|---|
| -f | ms | Audio/video sync fudge. | Only used to fix transcode sync problems. See -D tcmplex option documention for details. | 0 |
| -i | dir | Source /device. | Default should be fine. | /dev/dvd |
| -w | dir | Working directory. | Point this to a nice big partition. | HOMEDIR/video |
| -a | chan | Audio channel to grab. | Default should be fine. | 0 |
| -o | name | Name of the resulting ISO file. | Unless -D option used or specified here, ISO filename incremented and not clobbered. | 0000.iso |
| -b | rate | Target audio bitrate. | Default should be fine. | 384 |
| -z | rate | Target audio frequency. | Default should be fine or a value of 0 forces ac3 pass through. | 48000 |
| -v | rate | Target video bitrate. | This should be adjusted if the transcoded title does not fit. | 3800 |
| -t | list | Comma seperated titles to include. | No spaces or other whitespace allowed. Great for removing the boring introduction stuff, or moving them to the end. | all |
| -h |   | Help. | Help. |   |
| -s |   | Scan the DVD and exit. | Just display information about DVD in the drive and exit. Does not clobber cache or log files. |   |
| -p |   | Split the DVD, do not transcode. | Use unmodified content from source DVD, including multiple audio tracks, subtitles, etc. Great and fast if the title(s) you are interested in will fit. |   |
| -q |   | Process by title instead of chapter. | ifogen tends to introduce a slight pause when playing back |   |
| -x |   | Known DVD-5 (4.7 Gig) DVD. Duplicate. | Pretty useless for DVD-9 format DVD's. Any region coding and encryption is lost. Bummer. |   |
| -r |   | Believe info from ripped vob, not DVD. | Sometimes tcprobe reads information from the DVD incorrectly resulting in sync issues. |   |
| -e |   | Do not use framerate fine tuning. | Basically limit the frequency to the 3 decimal places that tcpobe returns. |   |
| -k |   | Do everything but create an image. | Create output VOB's but not the ISO image. Useful when fixing sync problems to save time. |   |
| -V |   | Specify the name of the DVD volume. | Specify the name of the DVD volume. |   |
| -c |   | Clobber any preexisting working files. | All content on the HD is first erased before loading fresh data from the DVD. This option prevents the script from asking any pesky questions. |   |
| -d |   | Delete some working files as we go. | If something goes wrong it takes a couple hours to reproduce the deleted files using this option. Not reccommended but it does save HD space. |   |
| -D |   | Delete all working files as we go. | Really not reccommended, like -d option but also deletes transcoded video and old ISO images. |   |
| -- |   | Pass all otions after this to transcode. | Useful when 'no' isn't an option when fixing transcoding sync problems. Overrides script values. |
The following are examples of typical commands executed on your behalf by the script. And no, I don't know what all the transcode options mean, but it seems to work. Many of the values for the options shown below are dynamic and may change from DVD to DVD.
In general, the newer version of transcde you use the better off you are. Depending on your version of mkisofs (cdrecord) you may also need the dvdrtools (http://www.nongnu.org/dvdrtools/) package as well.
A kind soul who wishes to be anonymous has sent me an interesting shell script that can cut the transcoding time down to about a quarter of my script. He says that he is working on an option to split the DVD instead of shrink it, as well as being able to keep the subtitles when shrinking. No support or warranty of any kind goes with it. The script is called dvddup.sh and is currently at version 0.5
Another kind soul who wishes to remain anonymous has sent me another shell script that can cut the transcoding time down to about half of my script. No support or warranty of any kind goes with it. The script is called dvdtrans.sh and is currently version 0.1
I am a big fan of ReplayTV, which has turned out not only to be more hackable than the Tivo, but has a devoted fanbase that creates useful and easy to use utility software for it. For example, you can use DVArchive to get television shows from your ReplayTV and then use some other tools to create video DVD. Here is a script I wrote to automate the process. The script is called rtv2dvd.pl and is currently version 1.0
So far I am very happy with this script and don't plan on making any more major modifications. I can run this script with no human intervention, almost always resulting in a good backup. If you have any ideas on how to fix the occasional sync issues please let me know. I now personally use vobcopy to duplicate DVD-5 DVD's since it appears much more stable.
Be warned that if you use this code on copyrighted content then your government probably considers you a dirty, rotten, stinking, hellbound pirate, and (especially in the USA) you could face fines, confiscation of your computer(s) and/or imprisonment! This heinous crime is MUCH worse than ripping the tag off of your mattress, so if you get thrown in the pokey for using something you own, in private, strictly for your personal use, then it is your own damn fault.
| Version | Comments |
|---|---|
| 1.6 | Added -V switch |
| 1.5 | Updated to use dvdauthor 0.5. |
| 1.4 | Bug fixes. Added -q option. |
| 1.3 | Bug fixes. dvdbackup is buggier than I thought. Doublecheck when splitting! |
| 1.2 | Replaced -m and -s options with -t option. -s option now splits by title instead of transcoding. -x option now forces straight duplication. Setting -z to 0 forces ac3 pass through. Any options after -- are passed to and override transcode options. |
| 1.1 | Bug fixes. Added -p and -z options. |
| 1.0 | Initial Revision |
This document was last updated January 25, 2005.
James Bearden
is not responsible for all information accessible from this web page.
Links to the rest of the Internet point to material maintained by many
other people and organizations. Please read the following
disclaimer before use of this WWW page.