# DVD9 > DVD5 guide

## iainvt

This guide lets you rip a DVD (all titles or just the main movie) and burn it on a DVD-R (4.7) that will play on your standalone player.

 Tools needed: DVD:Rip / dvdauthor / transcode / mjpegtools / k3b

 Optional: Kavi2svcd /QDVDAuthor or Klvemkdvd.

 1) Rip the DVD title(s) to harddisk with DVD:RIP in a project folder. This will create VOB files of tthe chosen title in that folder containing the movie and the soundtrack you picked.

 2) Most of the time you will get around 5 or 6 numbered VOB's from a ripped title in your project folder. 

 Concatenate (merge)those VOB files into one by running in a console:

 cat *.vob > movie.vob 

 3) 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:

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

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

 They will run one after the other, don't worry and will produce an M2V and an AC3 file.

 4) 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 shrink ed.m2v -f 1.5 

 The 1.5 at the end is the shrink factor if you like. 1 keeps the movie the same (just a reference) and 2.0 would reduce it to 50% of its size. So 1.5 seems reasonable as it equals 75% of the original size once processed. 

 If you prefer you can calculate the exact factor yourself with this formula:

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

 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.

 5) Now we need to re multiplex those 2 files into a compliant DVDauthor file:

 mplex -f 8 -o final.mpg shrink ed.m2v video.ac3

 Note: mplex will detect if a pulldown is necessary and do it. 

 6) You can now add the 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) 

 - Populate de filesystem like so:

 dvdauthor -o newdvd final.mpg

 - Create DVD information (IFO) files:

 dvdauthor -o newdvd -T

 7)Burn the Video_TS and Audio_TS created with K3B DVD Video mode.

----------

## val

Thank you for your guide.

Can you explain a little more what each step is for?  

Why do we need to concatenate the vobs?  Why do we need to remove the m2v and the ac3?

Will this process make the dvd regionless?

----------

## iainvt

This was just an experiment of mine to see what I cold do, 

m2v is an mpeg 2 vid stream and ac3 is dolby digital

http://www.afterdawn.com/glossary/terms/m2v.cfm

the reason they are removed is that they are there for each vob, for this to work I found a single vob was the way forward, just like in dvd:rip, so making the vobs into one single one ensures that each vid stream runs one after the other.

There are simpler ways to backup whole disks as in my tutorial

here at the bottom of the page

https://forums.gentoo.org/viewtopic.php?t=174989&highlight=

I just wanted to see what was behind these.

----------

## originalbrownster

Hi,

Thanks for the guide, I'll give it a try.

So far I just use 'lxdvdrip' because it's easy to shrink dvd-9 to dvd-5 with it (single command)  but it does just the main feature. 

It would be nice to get the whole lot sometimes.

OB.

----------

## val

I've been using lxdvdrip also but I have disk it's not working with right now.  Maybe because the disk is corrupted.  I'm also trying to remove the region encoding because it's region 2.

----------

## iainvt

the region encoding should not matter with css, as this cracks all keys, sometimes I get disks that start and then stall, the passion of christ is one of them.

----------

## val

Well, what I mean is, will I be able to play the dvd in any stand alone player?

----------

## iainvt

I cant see why not if the stand alone player id modified for all regions

----------

## val

Right, but what if the player is not modified?  I want to burn a dvd for a friend and I don't want to tell him that he has to modify his player to play this one dvd.

Basically what I want to know is: does this process remove the region encoding from the actual dvd disk.

----------

## iainvt

no, but to make sure you could use the dvd shrink process I give, you can shrink and imply any encoding you want region 2 included.

----------

## val

How do you "imply an encoding"?

Anyway, this should have a warning that you need about 20G of free space to do it!   :Shocked: 

----------

## iainvt

eh 20gb, methinks you did sommit wrong dude

----------

## val

If you rip a 9Gb dvd, then concatinate all the vobs into all into another vob, it's going to be approximately another 9Gb.  You would need 18Gb to hold both copies....  

My file was about 6.5Gb, so I would have still needed 13Gb to follow your method.

I didn't do anything wrong.

----------

## iainvt

delete the original

----------

## Fungos Bauux

I have done a dd if=/dev/dvd of=movie.img   and  then: ogle movie.img 

and all features are there.. menus, extras and everything..  but i think that it was luck, this dvd havent region code neither css keys...  but I think that its a good try for some movies...   I will try to do a dd if=movie.img of=/dev/dvd  soon to see what will happen..  I think that it will work fine...

----------

## val

 *iainvt wrote:*   

> delete the original

 

GEE i WISH I THOUGHT OF THAT!  :Rolling Eyes: 

That will free up space after you copy, obviously, but in order to make the copy in the first place, you still need enough space for both to begin with.

Whatever, I'm sticking to lxdvdrip...

----------

## sleek

I'm having problems using 'lxdvdrip'. When it is done with the rip and the multiplexing stuff, I can preview the movie using xine. However, since the dvd was bigger than the 4.7GB size limit, there are no menus, etc. which is fine. The problem is that the video and the audio stream are not in sync at all. They are way off by at least 5-10 seconds. Is there anything I can do to prevent this from happening? Thanks

----------

## iainvt

OK OK I only tried to help with an info post, if you dont like it do not use it, just tried to show the whole process can be done in command line, appologies. I am getting pretty tired of sharing knowledge only to be flamed at. I just tried to give something back rather than just taking from the forums.

----------

## Ambys Shrink

 *iainvt wrote:*   

> OK OK I only tried to help with an info post, if you dont like it do not use it, just tried to show the whole process can be done in command line, appologies. I am getting pretty tired of sharing knowledge only to be flamed at. I just tried to give something back rather than just taking from the forums.

 

Personally, I appreciate the guide.  Thanks  :Very Happy: 

----------

## LeTene

I think it's a bloody good guide...and it plugged in the last gap in my DVD ripping quest, burning back to DVD. I could already rip DVDs, convert to AVI for PC-watching, etc all through my own scripts (using transcode & friends). It's always the Gentoo Way (tm) in my opinion to know what's going on under the hood, and more satisfying when you finally twig onto what's going on.

----------

## pactoo

What about simply a [l]dvd9to5 port  if any one feels appointed ?

http://lakedaemon.netmindz.net/dvd9to5/

or

http://ldvd9to5.gff-clan.net/?project=ldvd9to5

----------

## peabody12

region encoding is part of the css key system... whenever you extract a dvd and burn it back you will remove the region encoding.  the key is stored in a part of the dvd you can't burn to which is why you have to decrypt it, but you burn it back w/o a key or region demand.

----------

## digitalb0y

Thanks for the info, its nice to see how it can be done at on the command line

----------

## Dick Hertz

```

tcrequant -i movie.m2v -o shrink ed.m2v -f 1.5 
```

It doesn't work, all I get is a "shrink" file.  And dvdrip is a PoS.  Like most "free" software, it's half-assed, amateur built.

----------

## LeTene

 *Dick Hertz wrote:*   

> 
> 
> ```
> 
> tcrequant -i movie.m2v -o shrink ed.m2v -f 1.5 
> ...

 

See the -o part? That's the output file name...there's an extra space put in there by error - it should say "shrinked.m2v".

Buy XP, use DVD-Shrink - whinging sorted  :Rolling Eyes:  . As always, I say to people who make such comments "write a better one!", and claiming not to be a coder doesn't cut it...

And by the way, DVD Shrink is free software...

----------

## Dick Hertz

 *LeTene wrote:*   

>  *Dick Hertz wrote:*   
> 
> ```
> 
> tcrequant -i movie.m2v -o shrink ed.m2v -f 1.5 
> ...

 

I thought the "shrink" part was a parameter.  Ya know, like this:

```
mount -t iso9660 -o auto, loop=/dev/loop0 ripped_dvd.iso /foobar
```

The way it was shown was ambiguous.

I did as you said and got the m2v and ac3 files: 

```

foo@bar:/dvd/mash> ls -lh mash.m2v 

-rw-r--r--  1 foo users 7.0G Dec 19 19:16 mash.m2v

foo@bar:/dvd/mash> ls -lh mash.ac3 

-rw-r--r--  1 foo users 228M Dec 19 19:21 mash.ac3
```

 *Quote:*   

> Buy XP, use DVD-Shrink - whinging sorted  . As always, I say to people who make such comments "write a better one!", and claiming not to be a coder doesn't cut it...

 

My point is that a lot of that software does not function well.  Granted, most of it does all right, and it does all right enough that I use Linux as my everyday O/S, but it's not the case that everybody who runs XP is a jackass simply because a lot of the software for Linux is, frankly, wanting.  

Speaking of which, mplex still doesn't work: 

```
   

joe@phalaeonopsis:/dvd/mash> mplex -f 8 -o final.mpg mash_shrunken.m2v mash.ac3

INFO: [mplex] mplex version 1.6.2 (2.2.3 $Date: 2004/01/13 20:45:26 $)

   INFO: [mplex] File mash_shrunken.m2v looks like an MPEG Video stream.

   INFO: [mplex] File mash.ac3 looks like an AC3 Audio stream.

   INFO: [mplex] Video stream 0: profile 8 selected - ignoring non-standard options!

   INFO: [mplex] Found 1 audio streams and 1 video streams

   INFO: [mplex] Selecting dvdauthor DVD output profile

   INFO: [mplex] Multiplexing video program stream!

   INFO: [mplex] Scanning for header info: Video stream e0 (mash_shrunken.m2v) 

   INFO: [mplex] VIDEO STREAM: e0

   INFO: [mplex] Frame width     : 720

   INFO: [mplex] Frame height    : 480

   INFO: [mplex] Aspect ratio    : 4:3 display

   INFO: [mplex] Picture rate    : 29.970 frames/sec

   INFO: [mplex] Bit rate        : 4587200 bits/sec

   INFO: [mplex] Vbv buffer size : 229376 bytes

   INFO: [mplex] CSPF            : 0

   INFO: [mplex] Scanning for header info: AC3 Audio stream 00 (mash.ac3)

   INFO: [mplex] AC3 frame size = 1792

   INFO: [mplex] AC3 AUDIO STREAM:

   INFO: [mplex] Bit rate       :    57344 bytes/sec (448 kbit/sec)

   INFO: [mplex] Frequency      :     48000 Hz

   INFO: [mplex] SYSTEMS/PROGRAM stream:

   INFO: [mplex] rough-guess multiplexed stream data rate    : 5150600

   INFO: [mplex] target data-rate specified               : 10080000

   INFO: [mplex] Setting specified specified data rate: 10080000

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0 INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Scanned to end AU 0

   INFO: [mplex] Run-in Sectors = 89 Video delay = 13019 Audio delay = 16022

   INFO: [mplex] New sequence commences...

   INFO: [mplex] Video e0: buf= 237568 frame=000000 sector=00000000

   INFO: [mplex] Audio bd: buf=  16384 frame=000000 sector=00000000

   INFO: [mplex] Running out...

   INFO: [mplex] Video e0: buf= 235556 frame=000000 sector=00000001

   INFO: [mplex] Audio bd: buf=  16384 frame=000000 sector=00000000

**ERROR: [mplex] Need to split output but there appears to be no %d in the filename pattern final.mpg
```

I know that file is bad because: 

```
foo@bar:/dvd/mash> ls -lh final.mpg 

-rw-r--r--  1 foo users 6.0K Dec 20 23:48 final.mpg
```

What did I do wrong here?

----------

## ian!

I don't know why this thread hasn't been moved earlier.

Moved from 'Multimedia'.

----------

## mnxAlpha

That's because the output file is going to be greater than 2GB, and mplex is being careful (in case you're running a system that can't deal with files greater than 2GB). I can run mplex on files far larger than 2GB without any problems, and without any additional command-line options. Maybe mplex didn't get compiled with large file support for some reason?

However, you could try this:

```
mplex -f 8 -o final-%d.mpg mash_shrunken.m2v mash.ac3
```

That'll give you some sequentially numbered mpg files. You can stick them back together like this:

```
cat final-*.mpg > final.mpg
```

Obviously, delete them when you're finished. Not the ideal solution, but it should work.

----------

## Dick Hertz

 *mnxAlpha wrote:*   

> That's because the output file is going to be greater than 2GB, and mplex is being careful (in case you're running a system that can't deal with files greater than 2GB). I can run mplex on files far larger than 2GB without any problems, and without any additional command-line options. Maybe mplex didn't get compiled with large file support for some reason?

 

Would that be a kernel parameter or a USE flag?

----------

## aray

Hey!

Where can I get dvddirgen from? -Which package is it in?

Cheers,

A.

----------

## kc8tbe

Good question.

dvddirgen is part of the dvdauthor package, but you won't find it after version 0.6.8. From the changelog:

 *Quote:*   

> 
> 
> rename dvddirgen to dvddirdel to better reflect purpose
> 
> 

 

As nearly as I can tell, all dvddirdel does is rm everything in the directory you give it. If you give it a nonexistent directory, it does nothing. Personally, I don't use dvddirdel, but go directly to:

```

dvdauthor -o empty_dir movie.mpg

dvdauthor -o empty_dir -T

```

Of course, by the time you get to the second command empty_dir isn't empty anymore.

Hope this helps!

----------

## campenbe

Just tried your instructions the first time and they worked like a charm. I appreciate that posted them. Thanks!

 :Wink: 

----------

## brenden

 *Dick Hertz wrote:*   

> 
> 
> ```
> 
> tcrequant -i movie.m2v -o shrink ed.m2v -f 1.5 
> ...

 

dvdbackup is much better.

----------

## hunn

I found a nice little script which does all the work for you. Works like a charm! (well... still checking it out  :Smile:   )

It does almoust the same as in the first post, except it uses mplayer to extract the mpg-stream direct from the DVD:

```
mplayer -dvd-device $dvd dvd://$title -dumpstream -dumpfile $path/dv_output/output.mpg
```

Gets rid of all the vob-troubles  :Very Happy: 

Hope its for any use!

----------

## brenden

 *hunn wrote:*   

> I found a nice little script which does all the work for you. Works like a charm! (well... still checking it out   )
> 
> It does almoust the same as in the first post, except it uses mplayer to extract the mpg-stream direct from the DVD:
> 
> ```
> ...

 

Nice, thanks.

----------

## Dr. Z

I would like to comment on my experience with this procedure.

First, realize that menus etc. will not work.  When I played back my

resulting disc, the first few seconds consisted of rapidly displaying

all the menus and special screens, followed by the main feature.  I

saw this on Ogle and one standalone DVD player; two other standalone

players could not handle the disc at all.

Second, mplex wants to split the final mpeg into MANY parts for me --

mjpegtools mplex-2 version 1.6.2 (2.2.3).  This is not a matter of

"2GB file size limitations"; it creates over 4000 mpeg files, most

between 4k and 6k in size.  I append a small script to demonstrate.

More seriously, each file appears to reset the System Clock Reference,

causing DVDauthor-0.6.10 to fail with the message

 *Quote:*   

> ERR: SCR moves backwards, remultiplex input.

 

 I was able to work around this by patching the source to DVDauthor and recompiling as advised on the DVDauthor mailing list.

http://sourceforge.net/mailarchive/forum.php?thread_id=4166113&forum_id=32261

Finally, audio and video came out badly out of sync.

Perhaps this would work great if I only used the VOBs for the main

feature without the menus and special features.  In fact I have

studied several archiving scripts based on transcode and NONE of them

preserve the menus on the original disc -- they all either work on a

single feature or create a new menu (such as eriks-dvd-rip).  DVD::Rip

seems promising but so far I only see how to back up to SVCD, not

DVD.  In short, the only solution which works for me at this time is

(shame to say) Wine+DVDShrink.

```

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

touch final.mpg

i=1

while [ -f final-$i.mpg ]

do

  cat final-$i.mpg >> final.mpg

  i=$[$i+1]

done

```

----------

## firex

2Dick Hertz:

the most opensorce developer in the first part of the day writing commercial software

and in the second thay spend the own free time to write free software.  :Smile: 

free software is a not a 

 *Dick Hertz wrote:*   

> 
> 
> Like most "free" software, it's half-assed, amateur built.
> 
> 

 

 :Exclamation: 

this software writting for fun then for money and is most better as commercial.

 :Smile: 

----------

## nexus780

Seems to work fine for me, thanks  :Smile: 

I'm gonna attempt to write a script for this, if I manage I'll post it here  :Smile: 

Edit: I just noticed, chapters don't seem to be working - anyone else having this problem?

----------

## m707

The best native linux solution for a dvd 9 to 5 job is lxdvdrip, as mentioned above, IMHO.

At present it offers all you need except preserving the original menus (if requantization is neccessary).

However, if you include dvdwizard, it will offer you a menu to select your audio $LANG (if more than 

one) and gives you a chapter selection menu offering thumbernails of each first sceen. It will preserve

subtitles marked as forced (or concluded in a separated stream marked as forced) and circumvent a 

lot of traps some other dvd9to5 tools do not care about at all. 

lxdvdrip acts as wraper for a bunch of tools like: mplayer, transcode, mplex, vamps, spu(un)mux, ifo_dump,

dvd(un)autor, streamdvd, dvdwizard, dvdbsckup, growisofs, cdrecord(-prodvd), mkisofs ......

Therefore it offers the greatest variety of choices. The basic concept is to use pipes where possible

(to avoid HD-space usage). It's also offering requanting by using vamps pipes in the dvdauthor 

xml syntax, so there is no need to a/v split the stream before requanting ([part]copy)

Of course, you have to spend some time to make you familiar with its options and functionality, but

IMHO its worth a trial if you want to avoid crowding you box using wine/dvdshrink.

At present the most prommising attempts to preserve menus are in dvdunauthor probably using some

possibilities pgcedit is offering, too. However, it is still a real pain to get the job done  :Sad: .

----------

## val

 *iainvt wrote:*   

> OK OK I only tried to help with an info post, if you dont like it do not use it, just tried to show the whole process can be done in command line, appologies. I am getting pretty tired of sharing knowledge only to be flamed at. I just tried to give something back rather than just taking from the forums.

 

I appreciate your guide, but it's really frustrating when you ask a question and someone gives an utterly useless answer.  If you don't know the answer, don't try to give one.

----------

## tytus

I am trying to use lxdvdrip to copy a DVD. In the middle of the process it gives me the following error:

```
   INFO: [???] mplex version 1.6.1.93 (2.2.3 $Date: 2004/01/13 20:45:26 $)

REQUANT START

REQUANT RETURN

   INFO: [???] File unnamed-0xe0.m2v looks like an MPEG Video stream.

   INFO: [???] File unnamed-0x80.ac3 looks like an AC3 Audio stream.

   INFO: [???] Video stream 0: profile 8 selected - ignoring non-standard options!

   INFO: [???] Found 1 audio streams and 1 video streams

   INFO: [???] Selecting dvdauthor DVD output profile

   INFO: [???] Multiplexing video program stream!

   INFO: [???] Scanning for header info: Video stream e0 (unnamed-0xe0.m2v) 

   INFO: [???] VIDEO STREAM: e0

   INFO: [???] Frame width     : 720

   INFO: [???] Frame height    : 480

   INFO: [???] Aspect ratio    : 4:3 display

   INFO: [???] Picture rate    : 29.970 frames/sec

   INFO: [???] Bit rate        : 9800000 bits/sec

   INFO: [???] Vbv buffer size : 229376 bytes

   INFO: [???] CSPF            : 0

   INFO: [???] Scanning for header info: AC3 Audio stream 00 (unnamed-0x80.ac3)

   INFO: [???] AC3 frame size = 1792

   INFO: [???] AC3 AUDIO STREAM:

   INFO: [???] Bit rate       :    57344 bytes/sec (448 kbit/sec)

   INFO: [???] Frequency      :     48000 Hz

   INFO: [???] SYSTEMS/PROGRAM stream:

   INFO: [???] rough-guess multiplexed stream data rate    : 0471000

   INFO: [???] target data-rate specified               : 10080000

   INFO: [???] Setting specified specified data rate: 10080000

   INFO: [???] Run-in Sectors = 89 Video delay = 13019 Audio delay = 15060

   INFO: [???] New sequence commences...

   INFO: [???] Video e0: buf= 237568 frame=000000 sector=00000000

   INFO: [???] Audio bd: buf=  16384 frame=000000 sector=00000000

REQUANT START at 15MB, 1 PGCS

REQUANT RETURN

REQUANT START4 at 37MB, 1 PGCS

REQUANT RETURN

REQUANT START4 at 56MB, 1 PGCS

REQUANT RETURN

REQUANT START0 at 79MB, 1 PGCS

REQUANT RETURN

REQUANT START0 at 100MB, 1 PGCS

REQUANT RETURN

REQUANT START0 at 119MB, 1 PGCS

REQUANT RETURN

REQUANT START0 at 139MB, 1 PGCS

REQUANT RETURN

REQUANT START4 at 157MB, 1 PGCS

REQUANT RETURN

REQUANT START4 at 179MB, 1 PGCS

REQUANT RETURN

**ERROR: [???] Can't find next AC3 frame: @ 18523904 we have 93c0 - broken bit-stream?

ERR:  Error reading from pipe: No such file or directory

dvdauthor -T -o /tmp/film-dvd

DVDAuthor::dvdauthor, version 0.6.11.

Build options: gnugetopt magick iconv freetype

Send bugs to <dvdauthor-users@lists.sourceforge.net>

INFO: dvdauthor creating table of contents

ERR:  No .IFO files to process

'dvdauthor -T' gives an error. Try a new authorisation? (y=Yes)

n

eject /dev/dvd
```

This is probably mplex error. Has anybody seen this? Is it possible that it has something to do with the DVD imperfection (e.g scratch)?

----------

## m707

I don't think it is an mplex error. In spite:

```

**ERROR: [???] Can't find next AC3 frame: @ 18523904 we have 93c0 - broken bit-stream? 

```

is a message from mplex I suppose something previous in the toolchain breaks.

At first I would try a different streamtool (-st). My favourits list:

- trans_par

- mplayer

-copy

If you know which titleset it breaks, you can of course have very rudimental scratching check using:

```

mplayer -dumpstream -dumfile film.mpg dvd://[TitlesetNumber]

```

lsdvd should give you a hint in which titleset is the main title. If this does not work, too. I would

try to borrow another dvd of the same content to see if it is really scratch based. In the meantime

the DVD industry set up new weapons (e.g. broken sectors) and I don't know if lxdvdrip will handle it.

If your problems are really based on scraches and the content is not available in new (e.g. some self made 

holiday film) you can try to find a CD/DVD polish set to fix the scratches. Probably a copy using ddrescue first

could be of assistance in this case.

----------

## tytus

Your were right. I tried st=transcode and the problem did not show up. I also tried trans_par and mplayar. Both of this methods seem to be a bit more reliable. But my experience is very short  :Smile: 

Thanks

----------

## ericxx2005

I use dvdshrink with wine: https://forums.gentoo.org/viewtopic-t-333140.html

If you don't mind using wine, and you like the 'click and go' way, it's not bad.  You can remove audio tracks/subpictures, and you can keep the extras if you want.

----------

## Dr. Z

Wine works fine for me but does anyone know how to do it non-interactively?

E.g. I'd like to compress 5 DVD's one after the other in the middle of the night,

without having to get up and click on some buttons and type in paths every

hour or two.  Maybe a Wine scripting language, or app-specific DVDShrink scripts,

or some Windows program to generate mouse and key events?

----------

## Rodent

Great guide, exactly the type of info I was looking for. Thank you so much, you saved me hours upon hours I am sure.

For people complaing about space req. using pipes like the below commands will get it to a min.

BTW, I am just posting to spread information, I don't really want to help people with problems, so RTFM before you ask. And please help out if you figure out how to cat the VOB's directly off the DVD (I can't figure out inline CSS decryption).

Max possible space usage: <=9.0GB (full DVD backup) + ~300MB (audio) + <=4.7GB (burnable dvd file system) == ~14.0 GB (total)

further this maybe slightly faster as its not thrashing your hd as much.

```
# - get the vob's you want using whatever tool you want (I like dvdbackup)

#   I find it useful to go though the VOB's with mplayer and cherry pick the ones I want

#   useing file wildcards or just fully list the VOB files after the cat in both commands bellow

#   like "cat VTS_01_1.VOB ... VTS_01_7.VOB | ..." or VTS_01_[1234567].VOB as shown

#   ASSUMEING PWD IS IN VIDEO_TS !!!

# - get the audio out 

cat VTS_01_[1234567].VOB | tcextract -a 0 -x ac3 -t vob > /tmp/dvd-work-dir/my-movie.ac3

# - now extract the video, compress (optional), mplex with audio, and finally write dvd file system

cat VTS_01_[1234567].VOB | tcextract -t vob -x mpeg2 | tcrequant -f 1.5 | mplex -f 8 -o /dev/stdout /tmp/dvd-work-dir/my-movie.ac3 /dev/stdin | dvdauthor -o /tmp/dvd-work-dir/my_movie /dev/stdin

# - remove un-needed crap now 

rm /tmp/dvd-work-dir/my-movie.ac3

rm -rf /tmp/dvd-work-dir/MY_MOVIE_FULL_BACKUP 

# - finally just to be complete, the rest of the above guide follows

# IFO files

dvdauthor -o newdvd -T

# Burn with k3b or like

growisofs -Z /dev/cdrom -dvd-video /tmp/dvd-work-dir/my_movie
```

And yes this destroys all chapter marks.

Aren't pipes neat, now you know what all the fuss is about. 

Dr. Z: if you know what vob files you want writtening a quick bash script should do one dvd at a time. Or all five if the vob files are on you hd already, then you just have to burn the resulting dvd-file structures

----------

## m707

14 GB != min

Please take a look at lxdvdrip. 

E.g. using the vamps backend -st (part-)copy, where vamps-play_title can be used directly in dvdauthors xml file, there is no need to spend more than the 4.3 GB you will burn afterwards. Of course vamps can preserve the chapter structur, can rip subtiltes and can requant mpeg2 without (de)muxing.

Even if you choose any other backend to have a chance to get your own menus using lxdvdrips dvdwizard integration you will not have to spend 14 GB.

----------

## Rodent

m707: Thanks for your comment. 

Like the orginal poster I realize that lxdvdrip (or other programs/scripts) are a cleaner/better solution to backup up dvds. I guess I should of just said that too like everybody else instead of realizing that the orginal (and my) instructions are more for education/fun than use. (didn't like 5 other people already note that lxdvdrip is better)

BTW, it would be possible to get a max of 5GB if there was a command line way of extracting off of the DVD using CSS and send output to stdin (aka pipe it). Yes 9GB of the 14 are because I can't read straight off of the dvd.  Of course it is prob. pretty easy to just whip up some c code to wrap the libcss libary into a command like that (note to self: good project to do this semester).

Further I fail to see how it would be possible to "requant mpeg2 without de(muxing)." I am no expert or even that knowledable on the subject but I am pretty sure thats just not possible. You don't have to write the a/v to a tmp file or anything but (de)muxing has to happen somewhere when you requant the video (even if just inline, like I did). Regardless I am going to do some further reading into this.

----------

## juniper

 *Rodent wrote:*   

> m707: Thanks for your comment. 
> 
> Like the orginal poster I realize that lxdvdrip (or other programs/scripts) are a cleaner/better solution to backup up dvds. I guess I should of just said that too like everybody else instead of realizing that the orginal (and my) instructions are more for education/fun than use. (didn't like 5 other people already note that lxdvdrip is better).

 

a whole bunch of folks have said this.  can someone post a nice, lovely, step by step use of lxdvdrip to do the same job?  please?  be your best friend?

that would be great, because i find wading through dvd authoring stuff difficult as ripping etc takes a long time.

j

----------

## Rodent

lxdvdrip is pretty much install/configure, excute, done. As for a guide I don't know what to say except I had to install streamdvd. And edit /etc/lxdvdrip.conf  line #37 dvdbrenner=/dev/scd0 to dvdbrenner=/dev/dvd

```
echo "media-video/lxdvdrip ~x86" >> /etc/portage/package.keywords

echo "media-video/streamdvd ~x86" >> /etc/portage/package.keywords

emerge -av streamdvd lxdvdrip

# insert your dvd 

lxdvdrip

# follow instructions
```

----------

## BlueShadow

Hi there! Great guide, works fine. But i got some additional questions:

How can i get multiple languages on my dvd and is it possible to also copy the subtitles?

I figured who to copy multiple audio streams, but i would like no name them. So the DVD-Player displays e.g. "English, German" now it only displays "??, ??".

Then if it is not possible to get the original chapters, can you generate them yourself (like all 10 minutes or somthing like that)?

thanx!

----------

## benny1967

 *BlueShadow wrote:*   

> 
> 
> Then if it is not possible to get the original chapters, can you generate them yourself (like all 10 minutes or somthing like that)?
> 
> 

 

Blue, as for the original chapters, it should work using something like this snip of code i found here:

```

## Retrieve the chapter list.

echo "Retrieving chapter list from DVD"

tcprobe -i /dev/dvd -T 1 -H 10 2>&1 | egrep "\[Chapter ..\] " | \

cut -d " " -f 4 | perl -pi -e 's/\n/,/' | \

perl -pi -e 's/,$//' >chap.list 

```

this will generate a list of chapters you should be able use with DVDauthor, either within the XML file or from the command line with the -c parameter.

----------

## IvanZD

 *Dick Hertz wrote:*   

>  *mnxAlpha wrote:*   That's because the output file is going to be greater than 2GB, and mplex is being careful (in case you're running a system that can't deal with files greater than 2GB). I can run mplex on files far larger than 2GB without any problems, and without any additional command-line options. Maybe mplex didn't get compiled with large file support for some reason? 
> 
> Would that be a kernel parameter or a USE flag?

 

No, just use -M switch in command and everything should be fine.

----------

## Schizoid

I am stuck at the mplex step (5) in this process...

I have issued the command:

mplex -f 8 -o final.mpg /mnt/hda4/tmp3/shrinked.m2v /mnt/hda4/tmp3/movie.ac3

in the original post it says:

mplex -f 8 -o final.mpg shrink ed.m2v video.ac3

I assume by video.ac3 you really mean movie.ac3 which was made with the tcextract command in step 3?

So assuming my change is correct, the output I get is...

**ERROR: [mplex] Can't find next AC3 frame: @ 101976576 we have 2504 - broken bit-stream?

after a few minutes.

Watching final.mpg only shows about 15 minutes of the film.

Did I screw up somewhere?

One thing I did do was when merging all the VOB files with the cat command I was actually merging 8 vob files that were from two different titles on the dvd. The particular dvd I am using is 170 minutes of video and they have broken it up into two titles on the dvd.

I also used dvdbackup to rip the vobs instead of dvd::rip since I am working with the command line only.

dvdbackup -i /dev/dvd -t 1 -o /mnt/hda4/tmp1

dvdbackup -i /dev/dvd -t 2 -o /mnt/hda4/tmp2

Should this be a problem?

I would blame the fact that I merged vobs from two different titles but mplex stops long before it gets that far in the merged VOB file.

Thank you for any assistance. If there is a better way to do a dvd9-dvd5 that is made of two titles I would love to know.

edit: I tried with final-d%.mpg so mplex would spit out chunks but that didn't help either.

----------

## uber.grog

Hi all. I've been really working to get the original script working, but for me it stops at mplex:

```
   INFO: [mplex] Average bit-rate :  3335600 bits/sec

   INFO: [mplex] Peak bit-rate    : 53898400  bits/sec

   INFO: [mplex] BUFFERING stream too short for useful statistics

   INFO: [mplex] AUDIO_STATISTICS: bd

   INFO: [mplex] Audio stream length 546093056 bytes.

   INFO: [mplex] Frames         :   312084

   INFO: [mplex] BUFFERING stream too short for useful statistics

**ERROR: [mplex] MUX STATUS: Frame data under-runs detected!
```

I've converted the whole process into my own script, so maybe there's something I've done wrong earlier in the process (see below, untested past mplex). Check out the multiple mplex lines to see what I've tried. Coments and/or help greatly appreciated. I just emerged wine, but would really prefer not to go the dvdshrink route!!  :Sad: 

```
#!/bin/sh

# dvd-copy.sh

# from http://forums.gentoo.org/viewtopic.php?t=244625

error_exit() {

    echo "${0##*/} ** ${1:-There has been an error}" >&2

    echo "Usage: ${0##*/} [-d destdir] [-t title]" >&2

    exit 1

}

WORKDIR=path_to_temp_dir

DRIVEIN=/dev/hda

DRIVEOUT=/dev/hdb

while getopts d:t: OPTFLAG; do

  case $OPTFLAG in

    d) [ ! -d $OPTARG ] && error_exit "Invalid backup dir specified"

       WORKDIR=$OPTARG

       ;;

    t) case $OPTARG in

            *[a-zA-Z0-9_-]*) DVDTITLE=$OPTARG ;;

            *) error_exit "the specified title cannot contain specifol chanraters" ;;

       esac

       ;;

    ?) error_exit ;;

  esac

done

shift $(($OPTIND - 1))

if [ -z "$DVDTITLE" ]; then

    DVDTITLE=${DVDTITLE:-$(dvdbackup -i $DRIVEIN -I)} || error_exit

    [ -z "$DVDTITLE" ] && error_exit "error findind dvd title"

fi

AUDIO=$DVDTITLE.AC3

FULL_VIDEO=$DVDTITLE-FULL.M2V

SHRUNK_VIDEO=$DVDTITLE-SHRUNK.M2V

FINAL_VIDEO=$DVDTITLE

set -x

cd $WORKDIR || error_exit

# rip the whole dvd

dvdbackup -M -i $DRIVEIN -o $WORKDIR || error_exit

# eject the disc to indicate the rip function has completed

eject -v $DRIVEIN

cd $DVDTITLE/VIDEO_TS || error_exit

# demutliplex to create m2v & ac3 files.

cat *.VOB | tcextract -t vob -x mpeg2 > $FULL_VIDEO || error_exit

cat *.VOB | tcextract -a 0 -x ac3 -t vob > $AUDIO || error_exit

# calculate the REQUANT_FACTOR (the factor to shrink to fit onto a 4.7GB dvd)

VIDEO_SIZE=$(command ls -l $FULL_VIDEO | awk '{print $5}') || error_exit

[ $VIDEO_SIZE -lt 1 ] && error_exit

AUDIO_SIZE=$(command ls -l $AUDIO | awk '{print $5}') || error_exit

[ $AUDIO_SIZE -lt 1 ] && error_exit

REQUANT_FACTOR=$(echo "scale=1; ($VIDEO_SIZE / (4700000000 - $AUDIO_SIZE)) * 1.04" | bc) || error_exit

DECIMAL=${REQUANT_FACTOR%%.*}

REMAINDER=${REQUANT_FACTOR##*.}

if [ $DECIMAL -gt 1 ] || [ $DECIMAL -ge 1 -a $REMAINDER -gt 0 ]; then

    # requantize (shrink) the video to fit on a 4.7M dvd.

    # NB: the higher the requantize value, the smaller the output (1.5 = 75%, 2 = 50%, etc)

    tcrequant -i $FULL_VIDEO -o $SHRUNK_VIDEO -f $REQUANT_FACTOR || error_exit

else

    ln -s $FULL_VIDEO $SHRUNK_VIDEO

fi

# re-multiplex the 2 files into a compliant DVDauthor file

#mplex -v 0 -f 9 -o $FINAL_VIDEO-%d.MPG $SHRUNK_VIDEO $AUDIO || error_exit

#mplex -v 0 -f 8 -o $FINAL_VIDEO-%d.MPG $SHRUNK_VIDEO $AUDIO || error_exit

#mplex -v 0 -f 8 -r 9400 -o $FINAL_VIDEO-%d.MPG $SHRUNK_VIDEO $AUDIO || error_exit

#mplex -v 0 -f 8 -V -o $FINAL_VIDEO-%d.MPG $SHRUNK_VIDEO $AUDIO || error_exit

mplex -f 8 -o $FINAL_VIDEO-%d.MPG $SHRUNK_VIDEO $AUDIO || error_exit

# create a dvd structure in a folder named NEWDVD

(N=1; while true; do cat $FINAL_VIDEO-$N.MPG 2>/dev/null || break; N=$((N+1)); done) | dvdauthor -o NEWDVD - || error_exit

# Create DVD information (IFO) files:

dvdauthor -o NEWDVD -T || error_exit

if [ $DRIVEIN = $DRIVEOUT ]; then

    echo "HIT ENTER WHEN THE BLANK DISC IS READY IN THE DRIVE"

    read READY

fi

# make sure the drive closed

eject -vt $DRIVEOUT

#cdrdao write --device $DRIVEOUT --driver generic-mmc -v 2 --eject NEWDVD || error_exit

growisofs -Z $DRIVEOUT -dvd-video ./NEWDVD || error_exit
```

----------

## Gotterdammerung

DVDStyler does some of these steps for the user.

----------

