Difference between revisions of "Dvdbackup"

From ArchWiki
Jump to: navigation, search
m (moved Make backup of DVD Video to Dvdbackup: Consolidating resources; DVD Ripping will be the "general" article)
(the "old method" is described in MUCH MUCH more detail in Convert any Movie to DVD Video; rewrite)
Line 1: Line 1:
 
[[Category:Audio/Video (English)]]
 
[[Category:Audio/Video (English)]]
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
 +
{{Article summary start}} {{DISPLAYTITLE:dvdbackup}}
 +
{{Article summary text|An introduction to the {{Codeline|dvdbackup}} utility, with examples.}}
 +
{{Article summary heading|Available in languages}}
 +
{{i18n entry|English|dvdbackup}}
 +
{{Article summary heading|Related articles}}
 +
{{Article summary wiki|DVD}}
 +
{{Article summary wiki|DVD Ripping}}
 +
{{Article summary wiki|DVD Writing}}
 +
{{Article summary end}}
  
:''The elegant method is for people who have a DVD Video and wants backing it up, eventually removing unnecessary features. The 'Older' method is for people who have a movie file, like and .avi or a .mov, and want making a true DVD Video''
+
There are several ways to backup DVD videos; see [[DVD Ripping]]. Many methods are slow, and require several steps to accomplish. {{Package Official|dvdbackup}} provides a simpler method (with some help from {{Package Official|dvdauthor}}). The {{Codeline|dvdbackup}} program is elegant because it does not demux/remux/transcode/reformat the movie. This means the backup process is done in one step.  
  
==Elegant Method==
+
==Installation==
===Introduction===
 
While dual layer DVD recorders are readily available and inexpensive, dual layer media is still not very easy on the wallet. Even if it were affordable, there are some of us who would prefer to simply make a backup copy of a movie, and not all the extra features that nobody watches more than once.
 
  
There are several ways to get what you want done, and many of them are slow, and require several steps to accomplish. Here's a simpler method using dvdbackup and dvdauthor, which can be both be found in the AUR. We will also be using mkisofs (found in the cdrtools package), and growisofs.
+
{{Package Official|dvdbackup}} is available in {{Codeline|[extra]}}:
  
For a truly elegant GUI based one step method of backing up DVD9 video to DVD5 (e.g. standard cheap DVD-R) why not have a look at k9copy (see links below)?
+
# pacman -Sy dvdbackup
  
===Making a Backup===
+
{{Package Official|dvdauthor}} is available in {{Codeline|[extra]}}, but is only required if backing up specific titles or title sets.
The dvdbackup program is elegant because it doesn't have to demultiplex, remultiplex, re-encode, or reformat the movie. This means the backup process is done in one step. The only time to not use this method is for longer movies (greater than 2 or 2.5 hours ... anything that won't fit on a single layer DVD). In those cases, have a look at the Long Method below.
 
  
Anyway, let's determine which title to backup. Here's the command to retrieve some information from your DVD. Replace /dev/hdc with the proper drive, of course.
+
# pacman -S dvdauthor
dvdbackup -i/dev/hdc -I
+
 
 +
{{Package Official|libdvdcss}} is available in {{Codeline|[extra]}} and is required to read encrypted DVDs:
 +
 
 +
# pacman -S libdvdcss
 +
 
 +
==Examining the DVD==
 +
First, determine which title to backup. The following command retrieves information about the DVD:
 +
$ dvdbackup -i /dev/dvd -I
 +
 
 +
After some less useful information, {{Codeline|dvdbackup}} will display something similar to the following:
 +
{{Command
 +
|name=dvdbackup -i /dev/dvd -I
 +
|output=<nowiki>
 +
[...]
  
After some less useful information, dvdbackup will show something like this:
 
<pre>
 
 
Main feature:
 
Main feature:
 
Title set containing the main feature is  1
 
Title set containing the main feature is  1
Line 28: Line 45:
 
The main feature has a maximum of 28 chapter(s) in on of it's titles
 
The main feature has a maximum of 28 chapter(s) in on of it's titles
 
The main feature has a maximum of 6 audio channel(s) in on of it's titles
 
The main feature has a maximum of 6 audio channel(s) in on of it's titles
</pre>
+
</nowiki>}}
 +
 
 +
This indicates that the main feature is in title set 1. Next a list of title sets is displayed:
 +
{{Command
 +
|name=dvdbackup -i /dev/dvd -I
 +
|output=<nowiki>
 +
[...]
  
What we're concerned with is that the main feature is in title set 1. Next we'll see a list of title sets:
 
<pre>
 
 
Title Sets:
 
Title Sets:
  
Line 44: Line 65:
 
Title 1 has 28 chapter(s)
 
Title 1 has 28 chapter(s)
 
Title 1 has 6 audio channle(s)
 
Title 1 has 6 audio channle(s)
</pre>
+
</nowiki>}}
  
Obviously, the main feature is title 1. Sometimes a titleset will include more than one title, sometimes not. Title sets can also include menus, which will no longer work very well if we're not backing up the entire DVD.
+
The main feature in this example is title 1. Sometimes a title set will include more than one title, sometimes not. Title sets can also include menus, which will no longer work well if not backing up the entire DVD.
  
Now to rip the DVD! We're using the drive /dev/hdc, ripping title 1, and outputting to our home directory.
+
==Ripping the DVD==
dvdbackup -i/dev/hdc -t1 -o/home/steve
+
{{Tip|{{Codeline|dvdbackup}} reads the name of the DVD and creates a working directory for it. If {{Codeline|dvdbackup}} decides the name of the DVD is too generic (like MOVIE, for instance), the user must specify a name, as it will refuse to run otherwise. Just use {{Codeline|-n MOVIE_NAME}} to specify.}}
  
dvdbackup reads the name of the DVD and creates a directory for it. If dvdbackup decides the name of the DVD is too generic (like MOVIE, for instance), you will have to specify a name, as it will refuse to run otherwise. Just use -nMYMOVIENAME to specify.
+
===A single title===
 +
The {{Codeline|-t}} option allows you to extract a specific title:
 +
$ dvdbackup -i /dev/dvd -o ~ -t 1
  
===Creating IFO and BUP Files===
+
You will now see a number of VOB files on the hard drive (in {{Filename|~/MOVIE_NAME}}). These files can be played in [[MPlayer]] or [[VLC]], but are insufficient to create a DVD copy! This is where {{Codeline|dvdauthor}} is useful.
If you know much about DVDs, you'll notice that we only have a number of VOB files on our hard drive, and that's not enough to burn a copy! This is where dvdauthor comes in.
 
  
First, we need to create a working directory. Then we're going to the directory that contains the VOB files. Be aware that this command is going to make a copy of the entire movie. The original can be deleted right afterwards.
+
A title set must now be created (e.g. {{Filename|VTS_01_0.IFO}} and {{Filename|VTS_01_0.BUP}}). Be aware that the following command will make a copy of the entire movie. The original can be deleted right afterwards.
  mkdir /home/steve/dvd
+
  $ mkdir ~/dvd
  cd /home/steve/MYMOVIENAME/VIDEO_TS
+
  $ cd ~/MOVIE_NAME/VIDEO_TS
  dvdauthor -o /home/steve/dvd *.VOB
+
  $ dvdauthor -o ~/dvd *.VOB
  
dvdauthor just created a copy of our movie, and hopefully it worked alright. If it said anything like "SCR moves backwards, remultiplex input." there might be trouble. Before deleting any files, check the file sizes of the original VOB files compared to the copied ones. If they're all roughly the same, you may be OK. You can use mplayer to test the affected VOB file to see if there's anything missing. If so, you may have to go the long route. I haven't backed up many DVDs, but it appears this problem occurs with special features, and hopefully not actual movies.
+
{{Codeline|dvdauthor}} will create a copy of the movie. If it outputs anything like "SCR moves backwards, remultiplex input" there might be trouble. Before deleting any files, check the file sizes of the original VOB files compared to the copied ones. If all roughly the same size, you may be alright. You can use [[MPlayer]] to test the affected VOB files to see if anything is missing.
  
Well, now we've built VTS_01_0.IFO and BUP. All we need is VIDEO_TS.IFO and BUP, and we're in business. This part takes much less time, and doesn't waste hard drive space.
+
Now, table of contents files must be created (e.g. {{Filename|VIDEO_TS.IFO}} and {{Filename|VIDEO_TS.BUP}}). This is much less time-consuming, and does not waste hard drive space:
  cd /home/steve/dvd/VIDEO_TS
+
  $ cd ~/dvd/VIDEO_TS
  dvdauthor -o /home/steve/dvd -T
+
  $ dvdauthor -o ~/dvd -T
  
Now we can create an ISO image file, or burn straight to DVD.
+
===The main feature===
 +
The {{Codeline|-F}} option automatically detects the main feature (though not always correctly!) and copies the entire title set:
 +
$ dvdbackup -i /dev/dvd -o ~ -F
  
===Creating an ISO===
+
Now, table of contents files must be created (e.g. {{Filename|VIDEO_TS.IFO}} and {{Filename|VIDEO_TS.BUP}}):
The advantage to creating the ISO file is that you can test that everything works fine with mplayer before continuing. The disadvantage is of course that it takes up hard drive space again.
+
$ cd ~/MOVIE_NAME/VIDEO_TS
  mkisofs -dvd-video -udf -o dvd.iso dvd/
+
  $ dvdauthor -o ~/MOVIE_NAME -T
  
To test the image with mplayer, simply:
+
===The whole DVD===
  mplayer dvd:// -dvd-device dvd.iso
+
The {{Codeline|-M}} option will backup the entire DVD structure, including menus, special features, etc. This requires approximately 7 GB of disk space for most DVDs:
 +
  $ dvdbackup -i /dev/dvd -o ~ -M
  
If everything seems ok, we can burn the image. Yes, growisofs burns DVDs.
+
==Writing to disc==
growisofs -Z /dev/hdc=dvd.iso
 
  
===Burning Straight to DVD===
+
===Creating an ISO===
If we're pretty confident in our skills, we don't need to create and test an image, wasting time and hard drive space! We're basically merging the mkisofs with the growisofs commands listed above.
+
The advantage of creating the ISO file is that you can test that everything works fine with [[MPlayer]] before continuing. The disadvantage is that the ISO consumes hard drive space.
growisofs -dvd-video -udf -Z /dev/hdc dvd/
+
$ mkisofs -dvd-video -udf -o ~/dvd.iso ~/dvd # if a single title was extracted
 
 
 
 
==Long Method==
 
This method may be necessary if your movie is too long to fit on a single layer disc and you need to shrink the video file a bit, or if dvdauthor was giving you trouble with the method above. Hopefully, the latter case won't happen often.
 
 
 
Anyway, all you need is a tool called dvdshrink, which can be found in the AUR. It's a nice perl script with included GTK2 frontend, which utilizes many tools. Unfortunately, it takes many steps to get a burnable copy with this method, which is why it takes longer than dvdbackup. Of course, the advantage is that it can shrink the video file size if needed. I was able to burn a 2h 23m movie without shrinking, even though the discs say they can only hold 120m of video.
 
 
 
Anyway, run xdvdshrink.pl, the interface is pretty self-explanitory. Click the Configure button to set your DVD drive(s) and specify a working directory with lots of extra space. Save the settings and go back to the main screen. You can "Select from DVD" which title to rip, as well as the audio channel. Each time, the program will scan the DVD and present you with options. The title selection is pretty obvious, as there should be only one long title on there. For the audio selection, simply pick your language. You may also have options for 2 channel or 6 channel audio (stereo or 5.1). It's up to you which one you choose here.
 
 
 
If you have a DVD reader and a DVD burner, you can leave a blank disc in the burner, and enable "Force DVD burn (no prompt) on the right. If you only have a single DVD drive, just enable "Autoburn new DVD", and when the ripping is complete, the program will prompt you to insert a blank disc and hit enter to continue.
 
 
 
The other options you should enable are "Remove working files", "Shrink selected title to fit DVD5" if your movie is too long to fit on a single disc, and it's up to you if you want to "Delete logs". "Remove working files" is especially important, since a movie is roughly 4GB, and this process takes several steps, which may result in 12-20GB of usage on your hard drive, depending on what the program has to do.
 
 
 
Anyway, that should be all. Click "Start copy"!
 
 
 
==Older Method==
 
===Introduction===
 
Making a data DVD is simple. It only involves a single command in most cases. If you need to simply burn data onto a DVD, see the [[DVD_writing|DVD Writing Tutorial]]. However if you want a DVD that you can play in your DVD player, it gets a little more complex. You need to encode the source video, generate the layout of the disc (with menus, titles, chapters, etc), make the filesystem (generate an ISO), and finally burn the ISO. This tutorial will cover only the most basic way of making a video DVD- You place the DVD in your DVD player and a movie plays. You are encouraged to research each step further, as there are countless options and features you can add beyond this.
 
 
 
 
 
===Encoding Source Video===
 
If the video you want to burn to a DVD is already encoded to the proper format, then you can skip this step. You will need transcode and mjpegtools to encode the video to the proper format. Note that this only applies to AVI or MPEG files. If you are dealing with wmv, asf, mov, ogm, etc files, then you will need to use mencoder.
 
 
 
 
 
If you are dealing with another type of file, install mencoder (part of the mplayer package):
 
<pre>
 
pacman -Sy mplayer
 
</pre>
 
 
 
For NTSC:
 
<pre>
 
mencoder -o output_file.avi -ovc lavc -lavcopts vbitrate=5000:vhq \
 
  -ffourcc DX50 -oac pcm -srate 48000 -ofps 29.97 your_movie.mov
 
</pre>
 
 
 
For PAL:
 
<pre>
 
mencoder -o output_file.avi -ovc lavc -lavcopts vbitrate=5000:vhq \
 
  -ffourcc DX50 -oac pcm -srate 48000 -ofps 25 your_movie.mov
 
</pre>
 
 
 
 
 
Now you will have an AVI file that we can convert to DVD compatable video. Continue by installing the tools we will need:
 
 
 
<pre>
 
pacman -Sy transcode mjpegtools
 
</pre>
 
 
 
First we separate the audio and video from the source video and encode them to the proper formats using transcode:
 
 
 
<pre>
 
transcode -i source_video.avi -y ffmpeg -F mpeg2video --export_prof dvd-ntsc \
 
  --export_asr 2 -o video -D0 -b224 -N 0x2000 -s2 -m video.ac3 \
 
  -J modfps=clonetype=3 --export_fps 29.97
 
</pre>
 
 
 
'''-i''' is the source video you are working with. Change this to whatever the original file is called.
 
 
 
'''-o''' is the ouput filename. I'll just call it "video" to make it simple.
 
 
 
'''-m''' tells transcode to write the audio to a separate file, in this case ''video.ac3''
 
 
 
'''-export_asr''' is the aspect ratio. '''2''' is 4:3 ratio, and '''3''' is for 16:9 ratio. Change this to whichever one you want.
 
 
 
 
 
'''NOTE:''' The above command uses the NTSC compatable format. To encode to PAL format, you need to make a few changes:
 
 
 
''--export_prof dvd-pal''
 
 
 
''--export_fps 25''
 
 
 
 
 
This process will probably take some time. An hour long video could take 1-3 hours to encode depending on the speed of your computer. When complete, you will be left with a video.m2v file and video.ac3 file. These are DVD-compliant video and audio files, respectively.
 
 
 
The next step is to merge these 2 files into one DVD MPEG file using '''mplex''', part of the mjpegtools package.
 
 
 
<pre>
 
mplex -f 8 -o video.mpg video.m2v video.ac3
 
</pre>
 
 
 
Now is a good time to test the video.mpg file in your video player of choice, such as ''mplayer'' or ''xine''. If everything appears ok, then you can continue to the next step.
 
 
 
==Create DVD Structure==
 
In order to generate the layout of the DVD from your video files, you will need to use dvdauthor:
 
 
 
<pre>
 
pacman -Sy dvdauthor
 
</pre>
 
 
 
You can specify a lot of options via command line, but it is much easier to simply create an XML file with the appropriate options. dvdauthor can do just about anything, but it could get fairly complex and beyond the scope of this tutorial. We just want to put a DVD in the drive and have it play our video. The XML file should look like this:
 
 
 
<pre>
 
<dvdauthor>
 
    <vmgm />
 
    <titleset>
 
        <titles>
 
            <pgc>
 
                <vob file="video.mpg" />
 
            </pgc>
 
        </titles>
 
    </titleset>
 
</dvdauthor>
 
</pre>
 
 
 
You can name this file whatever you want. Let's just assume it is dvd.xml. Next, we will run dvdauthor to generate the structure of the DVD.
 
 
 
<pre>
 
dvdauthor -o dvd -x dvd.xml
 
</pre>
 
 
 
'''-o''' is the ouput directory. This can be whatever you please, but make sure the directory doesn't exist prior to running the command.
 
 
 
'''-x ''' the XML file to load settings from. Change this to whatever you named your XML file.
 
 
 
After dvdauthor completes doing it's thing, you will have a dvd/ directory in the current directory. These are the files you will want to burn to a DVD in the next step.
 
 
 
Links with more information regarding the XML file for advanced usage:
 
 
 
http://dvdauthor.sourceforge.net/doc/ex-title.html
 
 
 
http://www.tappin.me.uk/Linux/dvd.html#author
 
 
 
http://gecius.de/linux/dvd.html
 
 
 
 
 
===Generate the ISO and Burn the DVD===
 
This can actually be done in one step, but I will go over the 2-step process anyways, just in case you want to distribute an ISO to other people. For this step, we will need two packages; '''dvd+rw-tools''' and '''cdrtools'''
 
 
 
<pre>
 
pacman -Sy dvd+rw-tools cdrtools
 
</pre>
 
 
 
First, we make the filesystem using mkisofs, part of the cdrtools package:
 
 
 
<pre>
 
mkisofs -dvd-video -udf -o dvd.iso dvd/
 
</pre>
 
 
 
'''-o''' is the output file. Of course, this can be whatever you want.
 
 
 
'''dvd/''' is the directory generated by dvdauthor. If you used a different directory, of course you will need to change this.
 
 
 
Next, we use growisofs to burn the DVD:
 
 
 
<pre>
 
growisofs -Z /dev/hdd=dvd.iso
 
</pre>
 
 
 
That should be it! Make sure you change the device path to whatever your DVD burner is and specify the correct ISO filename you are using.
 
 
 
This can actually be done in one step, like I mentioned before, like so:
 
 
 
<pre>
 
growisofs -dvd-video -udf -Z /dev/hdd dvd/
 
</pre>
 
 
 
This will skip the ISO step and burn the filesystem directly to the DVD. Change the device name and the directory to fit your needs.
 
 
 
 
 
==More Information and Links==
 
 
 
mplayer/mencoder: http://www.mplayerhq.hu/
 
  
dvdauthor: http://dvdauthor.sourceforge.net/
+
or
 +
$ mkisofs -dvd-video -udf -o ~/dvd.iso ~/MOVIE_NAME
  
http://www.tappin.me.uk/Linux/dvd.html
+
To test the image with [[MPlayer]], simply:
 +
$ mplayer dvd:// -dvd-device ~/dvd.iso
  
http://gecius.de/linux/dvd.html
+
If everything seems fine, burn the image:
 +
$ growisofs -Z /dev/dvd=~/dvd.iso
  
http://forums.gentoo.org/viewtopic.php?t=117709
+
===Burning straight to DVD===
 +
If confident in our skills, creating and testing an image is a waste time and hard drive space! Basically, one can merge the mkisofs with the growisofs command listed above:
 +
$ growisofs -dvd-video -udf -Z /dev/dvd ~/dvd # if a single title was extracted
  
k9copy: http://www.kde-apps.org/content/show.php?content=23885
+
or
 +
$ growisofs -dvd-video -udf -Z /dev/dvd ~/MOVIE_NAME

Revision as of 18:53, 27 November 2009

Template:Article summary start Template:Article summary text Template:Article summary heading Template:I18n entry Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end

There are several ways to backup DVD videos; see DVD Ripping. Many methods are slow, and require several steps to accomplish. Template:Package Official provides a simpler method (with some help from Template:Package Official). The Template:Codeline program is elegant because it does not demux/remux/transcode/reformat the movie. This means the backup process is done in one step.

Installation

Template:Package Official is available in Template:Codeline:

# pacman -Sy dvdbackup

Template:Package Official is available in Template:Codeline, but is only required if backing up specific titles or title sets.

# pacman -S dvdauthor

Template:Package Official is available in Template:Codeline and is required to read encrypted DVDs:

# pacman -S libdvdcss

Examining the DVD

First, determine which title to backup. The following command retrieves information about the DVD:

$ dvdbackup -i /dev/dvd -I

After some less useful information, Template:Codeline will display something similar to the following: Template:Command

This indicates that the main feature is in title set 1. Next a list of title sets is displayed: Template:Command

The main feature in this example is title 1. Sometimes a title set will include more than one title, sometimes not. Title sets can also include menus, which will no longer work well if not backing up the entire DVD.

Ripping the DVD

Tip: Template:Codeline reads the name of the DVD and creates a working directory for it. If Template:Codeline decides the name of the DVD is too generic (like MOVIE, for instance), the user must specify a name, as it will refuse to run otherwise. Just use Template:Codeline to specify.

A single title

The Template:Codeline option allows you to extract a specific title:

$ dvdbackup -i /dev/dvd -o ~ -t 1

You will now see a number of VOB files on the hard drive (in Template:Filename). These files can be played in MPlayer or VLC, but are insufficient to create a DVD copy! This is where Template:Codeline is useful.

A title set must now be created (e.g. Template:Filename and Template:Filename). Be aware that the following command will make a copy of the entire movie. The original can be deleted right afterwards.

$ mkdir ~/dvd
$ cd ~/MOVIE_NAME/VIDEO_TS
$ dvdauthor -o ~/dvd *.VOB

Template:Codeline will create a copy of the movie. If it outputs anything like "SCR moves backwards, remultiplex input" there might be trouble. Before deleting any files, check the file sizes of the original VOB files compared to the copied ones. If all roughly the same size, you may be alright. You can use MPlayer to test the affected VOB files to see if anything is missing.

Now, table of contents files must be created (e.g. Template:Filename and Template:Filename). This is much less time-consuming, and does not waste hard drive space:

$ cd ~/dvd/VIDEO_TS
$ dvdauthor -o ~/dvd -T

The main feature

The Template:Codeline option automatically detects the main feature (though not always correctly!) and copies the entire title set:

$ dvdbackup -i /dev/dvd -o ~ -F

Now, table of contents files must be created (e.g. Template:Filename and Template:Filename):

$ cd ~/MOVIE_NAME/VIDEO_TS
$ dvdauthor -o ~/MOVIE_NAME -T

The whole DVD

The Template:Codeline option will backup the entire DVD structure, including menus, special features, etc. This requires approximately 7 GB of disk space for most DVDs:

$ dvdbackup -i /dev/dvd -o ~ -M

Writing to disc

Creating an ISO

The advantage of creating the ISO file is that you can test that everything works fine with MPlayer before continuing. The disadvantage is that the ISO consumes hard drive space.

$ mkisofs -dvd-video -udf -o ~/dvd.iso ~/dvd # if a single title was extracted

or

$ mkisofs -dvd-video -udf -o ~/dvd.iso ~/MOVIE_NAME

To test the image with MPlayer, simply:

$ mplayer dvd:// -dvd-device ~/dvd.iso

If everything seems fine, burn the image:

$ growisofs -Z /dev/dvd=~/dvd.iso

Burning straight to DVD

If confident in our skills, creating and testing an image is a waste time and hard drive space! Basically, one can merge the mkisofs with the growisofs command listed above:

$ growisofs -dvd-video -udf -Z /dev/dvd ~/dvd # if a single title was extracted

or

$ growisofs -dvd-video -udf -Z /dev/dvd ~/MOVIE_NAME