Mailinglist Archive: opensuse (3666 mails)

< Previous Next >
Re: [SLE] Need CLI help -DVD How-to
  • From: "B. Stia" <usr@xxxxxxxxxxx>
  • Date: Tue, 8 Mar 2005 00:24:24 -0500
  • Message-id: <200503080024.24964.usr@xxxxxxxxxxx>
On Monday 07 March 2005 10:05, Richard wrote:
> On Monday 07 March 2005 01:21 am, B. Stia wrote:
> > Congratulations to me!  Burnt my first ever movie DVD using the
> > reliable old CLI without encryption and will play in any player I
> > put it in.
> >
> > I know there are already a lot of people doing this, but if others
> > really want to know how to do this, I will be happy to supply the
> > how-to that I used and the sources for the programs used.  Thanks
> > Joe Morris & Packman !!
>
> Bob, I would like to see your howto and I'm sure others are equally
> interested. Why not post it here?
>
OK, for those requesting it. FIRST of all this is NOT my how-to. Found
it on the web after much searching. It is attached as a text file. If
the attachment should get munged the original can be found at
http://kavlon.org/index.php/dvdbackup

A few comments though. The author names the tools needed. Some are
already on your SuSE disk. Others can be found using apt or directly on
the ftp.gwdg.de site, both 32 & 64 bit versions (Packman &
suser-jmorris) I needed an additional program, mjpeg-tools, which I
got from the same sources.

The author also states that you should have about 30 GB of space. While
I am sure that may be true of the newer dual-layer DVD's, I did it in a
partition with only 7.5 GB and had plenty of room. What I did was to
delete a built package after it was no longer needed, thereby freeing
space for the next operation.

I didn't shrink the file because what I had was smaller than 4.7GB.
I did go through the steps though just to see what happens.

The author is a little unclear (to me anyway) under the "Preparing"
session. You will need to create a file called "dvd.xml" by inserting
the text he has provided in the how-to. Just open up kwrite, create it,
and save it. I just put this little file in the directory where I was
doing the building.

Have fun guys and gals. I sure did.

Bob S.


Intro to DVD Backup
January 22, 2005
by Michael <mogmios@xxxxxxxxxxxxxxxxx>
Intro

Most of us own at least a few DVD movies. The DVD has all but replaced the once popular VHS format. Unfortunately DVDs are not very durable. You may find yourself wanting to create backups of your DVD movies. This can be useful to increase the life of your movies as well as for additional purposes such as removing region locking or converting from PAL to NTSC. Since dual-layer discs are still quite costly, most of us choose to use the older 4.7GB discs which are much more affordable. Many DVD movies are larger than 4.7GB so that we can not make a direct copy of the DVD image from the original to our copy. For this reason we will need to shrink the original video to fit. This process is easy to do.

To begin you will need a computer running Linux and you will need several programs installed. At least you will need vobcopy, transcode, dvdauthor, and dvd+rw-tools. You should have either mplayer or xine installed so that you can test your finished DVD image before burning it to disc. Often these programs do not all come installed with your Linux distro but they should be easy to find packages for.

There are several graphical programs to ease this process but we will assume that you are a command-line user and want to understand the processes involved. Load up your favorite console program and move into a working directory. You will need access to your DVD drive so be sure to give yourself the permissions needed. You should make sure your have about 30GB of disk space to work on.
Ripping

The first step is to make an image of your original DVD. As we are shrinking the original we will start by getting rid of DVD extras such as menus and bonus material. We will use the vobcopy program to make an image of the movie portion of the DVD.

Note: vobcopy does not, as of this time, support ripping titles with multiple angles.

Most Linux systems can support large files so we will tell vobcopy to copy the entire movie into a single file. This will make the following steps much easier.

Put your original DVD in your DVD drive and run vobcopy. This will rip the first movie segment, called a title, on the DVD. This is the default.

vobcopy -l

On rare occasions the default title will not be the movie. Try ripping higher titles until you find the movie. You can specify which title to rip when running vobcopy. For example you might want to rip the second title on the DVD.

vobcopy -l -n 2

If you look in your working directory you should see a large vob file. The exact name of this file usually varies depending on the movie in the drive. Usually the name will reflect the name of the movie.
Shrinking

Now that we have an image of the movie we wish to work with we need to shrink the image to fit on the 4.7GB destination disc. This process has several steps. If the original vob file is less than 4.7GB in size you may be able to skip these steps. If you skip these steps and have trouble later you will need to come back and do them afterall.

The first step of shrinking is to extract the original video and audio into two separate files. You are extracting from a vob file and you want to save your video as mpeg2 and audio as ac3. Usually you will want to save the first, known as 0, audio track of your movie. In some cases you may want to select an alternative audio track. In that case put the number corresponding to the desired audio track rather than 0. If your vob file were INPUT.vob you would run these two commands.

tcextract -i INPUT.vob -t vob -x mpeg2 > movie.m2v

tcextract -i INPUT.vob -t vob -x ac3 -a 0 > movie.ac3

This will create a video file named movie.m2v and an audio file named movie.ac3. You will need to know by how much you need to shrink your video to make your movie fit on the new disc. You can guess or you can calculate it out. Choosing 1.5 is a fairly safe bet but you can be sure by working out the formula below. This should leave plenty of room for whatever menus you want to add. If your original vob file is 4.7GB or less then you can skip this step.
factor = ( m2v size / ( 4600000000. - ac3 size ) ) * 1.04

Usually it is a good idea to round your factor up at two decimal places. If you found you needed to shrink your video by a factor of 1.25 you would run the command below.

tcrequant -i movie.m2v -o shrink.m2v -f 1.25

This should leave you with a new video file named shrink.m2v. Now that you have shrank your video you will want to recombine it with your audio. In some cases you may have to allow more than one mpeg to be output. Including the '%d' in your output name assigns each of these files a unique number. If you did not need to shrink your video file then use movie.m2v instead of shrink.m2v.

mplex -f 8 -o "movie%d.mpg" shrink.m2v movie.ac3

Finally you have a finished movie, movie1.mpg, that should be under 4.7GB in size. If you had to split your output then look for multiple output mpegs such as movie1.mpg, movie2.mpg, and so on. It is a good idea, when you have multiple mpegs output, to verify them all. Any that are empty can probably be deleted. Including them in your finished DVD could cause errors. You can also delete any that you do not want included in your finished DVD for whatever reason. Now you are ready to format it as a DVD movie.
Preparing

You will need to define a menu for your new DVD movie. The easiest is to tell the movie to begin playing when the disc is loaded. You will create a file named dvd.xml to define this.

<dvdauthor>
<vmgm />
<titleset>
<titles>
<pgc>
<vob file="movie1.mpg" />
</pgc>
</titles>
</titleset>
</dvdauthor>

This tells the dvd player to begin playing movie1.mpg when the disc is loaded. If you had multiple mpegs output then simply list them each in turn in the order you want them to play. If you did not need to shrink your DVD image then you can put the name of your vob file in this place instead. Now we just create a new DVD image.

dvdauthor -o output -x dvd.xml

A new directory named output should exist now. Inside is all the information defining your new DVD image.
Verify

Using either mplayer or xine you should verify that your new DVD image runs properly. Especially you will want to make sure the audio and video are in sync and that the movie runs all the way to the end.

You can use mplayer for this.

mplayer -dvd-device /home/user/output/ dvd://

Or you can use xine.

xine dvd:/home/user/output/

Whichever program you have installed should work fine.
Burning

Finally you are ready to burn your new DVD movie to a disc. You will need to know the path to your DVD device and to the DVD image you created. Load a blank DVD disc into your burner and run growisofs.

growisofs -Z /dev/dvd -dvd-video output/

You should be ready to try your new DVD out in whatever DVD player you want to use. Most should be able to read a DVD+R or DVD-R disc without any problem.
Wrapping Up

These basics create the foundation of all DVD movie production under Linux. You can do much much more with the DVDs you produce. You can edit your movies, change soundtracks, add in sub-titles, and create fancy menus.

Copyright ©2005 Michael McGlothlin. Content may be copied and distributed in full or part as long as this copyright notice is attached.
< Previous Next >
References