DVD9 to DVD5

Based on http://www.linuxquestions.org/questions/showthread.php?t=244913&highlight=dvrequant

Keeping it as simple for newbies as it can be.

Tools needed:

Install programs

vi /etc/apt/source.list

deb http://mirrors.ecology.uni-kiel.de/debian/debian-multimedia etch main

apt-get update
apt-get install dvdrip
apt-get install dvdauthor
apt-get install mjpegtoos
apt-get install k3b

Transcode should be installed when you install dvdrip. To check do

apt-cache policy transcode


mkdir dvdrip-data


  1. When you start a DVDrip it will created the folder that we just created if its not there. Open a new project and save it. Now read the title list and you should see all the available titles. Pick the title that has most chapters. Usually that is what you want. Rip the selected DVD title(s) to hard disk. This will create VOB files of the chosen title in that folder containing the movie and the soundtrack you picked.

rip to harddrive usually does the job. You can select the all tracks or the big once.
  1. Most of the time you will get around 5 or 6 numbered VOB's from a ripped title in your project folder.
  2. Concatenate (merge) those VOB files into one by running in a console:

cat *.vob > movie.vob

cat /home/lucas/dvdrip-data/movie/vob/001/*.vob > /home/lucas/dvdrip-data/fullmovie.vob
  1. You now have 1 VOB file. We need to demutliplex it and get the M2V and AC3 files out of there. From the folder, again using the console run:

cd /home/lucas/dvdfolder
tcextract -i movie.vob -t vob -x mpeg2 > movie.m2v 

and after that:

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

This will produce a movie.M2V and a movie.AC3 file.

  1. To requantize (shrink like DVDShrink on Windoze) your movie so it will fit on a single DVD-R (4.7) do as such:

tcrequant -i movie.m2v -o shrinked.m2v -f 1.5

This will produce a file called "shrinked.m2v"

requant_factor = (video_size / (4700000000 - audio_size)) * 1.04

Personnaly I often get a value around 1.30 for a normal 2 hours movie. 1.04 is a value used to leave overhead space for menus and chapters If you are including more that one audio stream or a subtitle stream, those file sizes must also be subtracted from the maximum dvd image size. All sizes are in bits.

  1. Now we need to re multiplex those 2 files into a compliant DVDauthor file:

mplex -f 8 -o final.mpg shrinked.m2v movie.ac3

This will produce a file named: "final.mpg". Note: mplex will detect if a pulldown is necessary and do it.

  1. You can now add the file "final.mpg" to QDVDAuthor or Klvemkdvd authoring programs and create your DVD or use dvdauthor from the command line as such:

dvddirgen -o newdvd (create a dvd structure in a folder named newdvd)

dvdauthor -o newdvd final.mpg

dvdauthor -o newdvd -T
  1. Burn the Video_TS and Audio_TS created with K3B DVD Video mode.

Done. Happy authoring!


n the command "tcextract -i movie.vob -t vob -x mpeg2 > movie.m2v" movie.vob is the name of one file that contains all the ripped VOB's that I joined wiht the CAT command as indicated in step 2) of my guide.

Let's translate i. "tcextract -i movie.vob -t vob -x mpeg2 > movie.m2v" simply means extract the mpeg2 video stream from imput file (-i) movie.vob and save it as movie.m2v.

t is not "ed.m2v", read carefully, It is "shrinked.m2v". A space was mistakenly put there.

Can you see the wrong space "v ob" right before the ">movie.ac3". It should spell "vob".

Also to answer your last question, you can use dvdbackup without problem. It does the same as DVD::Rip. As long as you join the extracted VOB's with the CAT command.

typo in your first post, a space between shrink and ed.m2v (shrink ed.m2v, 4th step), which was why my pasting wasn't working. The video_ts dir was irrelevant, actually, I was inside it and the commands did not create any other dirs above that.

When I rip whit DVD::rip I rip only the main title and my language of choice (english ac3 6 channels). So actually there is no long presentation at all at the beginning. The movie starts right away. There is no loss of space for encoding.

Instead of mplex you could aslo use tcmplex. Sometimes one will work when the other ones does not. Use it like so for muxing DVD's:

tcmplex -o movie.mpg -i movie.m2v -p movie.ac3 -m d

but mplex should work now if you rip only the main movie titleset.

Although, if you manage to make this all work with all the titles on a DVD, tell me how. It could be possible.

[root@kmberry 002]# tcextract -i movie.vob -t vob -x mpeg2 > movie.m2v tc_memcpy: using mmxext for memcpy [root@kmberry 002]# tcrequant -i movie.m2v -o shrinked.m2v -f 1.5 tcextract -i movie.vob -a 0 -x ac3 -t vob > movie.ac3 tc_memcpy: using mmxext for memcpy mplex -f 8 -o final.mpg shrinked.m2v movie.ac3 INFO: [mplex] mplex version 1.6.2 (2.2.3 $Date: 2004/01/13 20:45:26 $) **ERROR: [mplex] Unable to read from movie.ac3.

tcextract cannot extract the audio from the vob made using dvdrip. The vob plays fine with sound using mplayer.

This is the command to backup everything on the DVD: dvdbackup -M -i/dev/dvd -o/my/dvd/backup/dir/


First of all.

You don't shrink or requantize a audio track. That is never done.

Only the video get's shrunked. that's it.

DVD movies with LPCM (Wav) format do exists. Wav PCM is a valid DVD compliant audio format.

Now what you need to do is extract the audio like so:

mplayer -vo null -nogui -aid 128 -ao pcm -aofile audio.wav *vob

This will extract any kind of audio to WAV PCM.

You have the choice of leaving it like that or convert it to AC3 stereo:

Like so (you need ffmpeg): ffmpeg -i audio.wav -ac 2 -ab 192 -ar 48000 audio.ac3

Then requantize your video as usual. just make sure you calculate the size of the audio file in the formula like it is demonstrated in my guide.

Then you have to remultiplex it:

WAV > mplex -f 8 -L 48000:2:16 -o final.mpg shrinked.m2v audio.wav

AC3 > mplex -f 8 -o final.mpg shrinked.m2v movie.ac3

That should work. Now I am going on vacation for 10 days so we will see when I get back.


I just issued this command: mplex -f 8 -o final.mpg shrinked.m2v movie.ac3 and this is what it returns... **ERROR: [mplex] Need to split output but there appears to be no %d in the filename pattern final.mpg ode:

mplex -f 8 -o final%d.mpg shrinked.m2v movie.ac3

The '%d' tells mplex how to number the output files. So if it's split in 2 pieces, it will be final1.mpg and final2.mpg.


To backup the main feature of the DVD:

dvdbackup -F -i/dev/dvd -o/my/dvd/backup/dir/

This action creates a valid DVD-Video structure of the feature title set

dvdbackup defaults to get the 16:9 version of the main feature if a 4:3 is also present on the DVD. To get the 4:3 version use -a 0.

dvdbackup makes it best to make a inteligent guess what is the main feature of the DVD - in case it fails please send a bug report.

To backup a title:

dvdbackup -t 1 -i/dev/dvd -o/my/dvd/backup/dir

This action backups all cells that forms the specified title. Note that there can be sector gaps in between one cell and an other. dvdbackup will backup all sectors that belongs to the title but will skip sectors that aren't a part of the title.

Dvdbackup should find the main movie by himself but if you want to see what is on the DVD and choose for yourself what you will rip you can do that like this to gather info about the dvd:

dvdbackup -i /dev/dvd -I


mplex is part of the mjpegtools package.

-f 8 means format (fmt) and 8 is the DVD with NAV sectors options.

The other options are: 0 = Generic MPEG1 1 = VCD, 2 = user-rate VCD 3 = Generic MPEG2 4 = SVCD 5 = user-rate SVCD 6 = VCD Stills 7 = SVCD Stills 8 = DVD with NAV sectors 9 = DVD

Tcmplex works fine (part of the Transcode package) also but instead its options are -m for mode and the flags are: 1 = mpeg1 vbr, buffer 46Kb (*** default XVCD) b = mpeg1 vbr, buffer 224Kb (experimental) 2 = mpeg2 vbr

What do you mean by: "no sound!" ?.

The you use the correct command? Like so to multiplex the mpeg stream and the audio:

tcmplex -o movie.mpg -i movie.m2v -p movie.ac3 -m d

Witch means: create movie.mpg from (-i) video input movie.m2v and (-p) audio stream movie.ac3 in DVD mode (-m d).

d = DVD s = SVCD v = VCD

So you would use -m d ase parameters for a DVD.


I use lxdvdrip to backup my DVD movies, it also is a 7 step process,

1) Insert DVD movie

2) click icon on desktop, or open terminal and run lxdvdrip

3) go get a cup of coffee

4) browse linuxquestions while ripping

5) insert blank DVD when the movie DVD is ejected

6) Open Xine

7) Play newly created backup.

In all sincerety, go get a copy of lxdvdrip, and read the instructions for dependencies http://developer.berlios.de/projects/lxdvdrip/

I have found that mplayer, libdvdcss, streamdvd, and dvdread from source are about all it requires, set up the lxdvdrip.conf file and live happily ever after.

Creating Menu

Creating the menus For PAL: Open up The Gimp and make a new image of size 720×576, with a resolution of 75dpi in the x-axis and 80dpi in the y-axis.

For NTSC: Make a new image of size 720x480, with a resolution of 81dpi in the x-axis & 72dpi in the y-axis.

Right click on the image, select Image -> Alpha -> Add channel. Right click on the image, select image -> Layers -> Layers, Channels & Paths Create a layer called 'button_highlight'. Create a layer called 'button_select'. Select the background layer & draw the menu background.

I chose to use the matrix 'green data dribble' as the background, which I downloaded from a free wallpaper website. Scaled the image to the correct 720x576, right click image -> Image -> Scale Image & set. Then copy/pasted it into the background layer of my new image. Here is the image -> http://mightylegends.zapto.org/dvd/matrix.jpg

I wanted to have selectable snapshots of each movie in the menu. Snapshots were taken using xine, images were scaled using gimp, then pasted into the background layer. Here is the image -> http://mightylegends.zapto.org/dvd/m...background.jpg

Select the button_highlight layer & draw the button outlines. To see howto draw perfect rectangles, squares & circles in the gimp, see here -> http://www.cubicdesign.com/gimp/1_3/ Here is the image -> http://mightylegends.zapto.org/dvd/m..._highlight.png

Hide the button_highlight layer & save the background layer. Do this by selecting the button_highlight layer & using the Opacity slider in the Layers, Channels & Paths dialog box to make it disappear. Click on the background layer, right click on the image, select File -> Save as Save background layer as 'matrix_menu_background.jpg'. (NOTE - Background MUST be a .jpg)

Save the button_highlight layer in the same way. Use the opacity slider to bring the button_highlight layer back up, & hide the background layer. Click on the button_highlight layer, right click on the image, select File -> Save as Save button_highlight layer as 'matrix_menu_highlight.png'. (NOTE - Button layer MUST be a .png)

Select the button_select layer & draw the button outlines exactly the same as button_highlight, but in a different color. An easy way to do this is to open matrix_menu_highlight.png, right click image, select Image -> Colors -> Color map rotation, set the colour to something different, but that will still be visible against the menu background colour. Save new colour image as 'matrix_menu_select.png'. (NOTE - MUST also be a .png) Here is the image -> http://mightylegends.zapto.org/dvd/m...enu_select.png

Note: Once your comfortable with the above, & everything is working, have a shot at creating an animated DVD menu. See here -> http://mightylegends.zapto.org/dvd/d...o_animenu.html

Putting it all together Convert the menu background into a DVD .mpg. For PAL: jpeg2yuv -n 50 -I p -f 25 -j matrix_menu_background.jpg | mpeg2enc -n p -f 8 -o matrix_menu_background.m2v

For NTSC: jpeg2yuv -n 50 -I p -f 29.97 -j matrix_menu_background.jpg | mpeg2enc -n n -f 8 -o matrix_menu_background.m2v

Create some background audio for the menu: mplayer yourmusicfile.mp3 -vo null -ao pcm -aofile menu_audio.pcm

Use 'normalize' to make audio softer/louder if necessary: normalize -a -10dB menu_audio.pcm

Convert to mpeg audio: mp2enc -r 48000 -o menu_audio.mpa < menu_audio.pcm

If you do not want any audio present in your menu, it is still necessary to create a silent audio file for mplex so the DVD menus will work correctly. Like this: For PAL: dd if=/dev/zero bs=4 count=1920 | toolame -b 128 -s 48 /dev/stdin menu_audio.mpa

For NTSC: dd if=/dev/zero bs=4 count=1601.6 | toolame -b 128 -s 48 /dev/stdin menu_audio.mpa

Merge background menu video/audio: mplex -f 8 -o matrix_menu.mpg matrix_menu_background.m2v menu_audio.mpa

Use spumux to merge button_highlight & button_select images into the menu video. Spumux is part of the dvdauthor package. It is configured via an .xml file. Here is the xml config file we will use, save it as 'spumux.xml': File: <subpictures> <stream> <spu start="00:00:00.0" end="00:00:00.0" highlight="matrix_menu_highlight.png" select="matrix_menu_select.png" autooutline="infer" autoorder="rows"/> </stream> </subpictures>

Create final menu .mpg: spumux spumux.xml < matrix_menu.mpg > matrix_menu_final.mpg

Authoring the DVD Dvdauthor is configured via a .xml file. Here is the .xml config file we will use, save it as 'dvdauthor.xml': File: <dvdauthor dest="DVD">

<vmgm> <menus> <pgc> <vob file="thx_dvd.mpg"/> <post> jump titleset 1 menu; </post> </pgc> </menus> </vmgm>

<titleset> <menus> <pgc> <button> jump title 1; </button> <button> jump title 2; </button> <vob file="matrix_menu_final.mpg" pause="inf"/> </pgc> </menus>

<titles> <pgc> <vob file="matrix_dvd.mpg"/> <post> call menu; </post> </pgc> </titles>

<titles> <pgc> <vob file="outtakes_dvd.mpg" /> <post> call menu; </post> </pgc> </titles>



Create a directory named 'DVD'. Create the DVD file structure with: dvdauthor -x dvdauthor.xml

Test the new menus in xine before burning: xine dvd:/full/path/to/DVD/VIDEO_TS/

Xine should play from the folder as though it's playing from a DVD.

MyWiki: DVD9toDVD5 (last edited 2009-09-06 02:50:32 by localhost)