# Rip a DVD

## guy

Hi everybody, I wrote this little script to easily rip DVDs. Before you get started, you'll need to

```

emerge lame

emerge mplayer

```

Also, your USE flags should include "encode" and "avi"

Now put this script somewhere useful (like /bin), switch to the folder you want the movie in, and run the script. (I call it "ripdvd")

This script uses mencoder, mpeg4 (divx), and a 3-pass encoding for the best quality. It also lets you specify the video bitrate before you begin or after the audio ripping, so that you can make it the exact size you want. Enjoy!

```

#! /bin/bash

echo "this will encode a dvd using the triple pass method.";

echo -n "audio bitrate? (rec: 120; 96 for long movie) ";

read abr;

echo -n "audio ID? (default = 128) ";

read lng;

echo -n "specify video bitrate now or wait for mencoder's recommendation (now/wait)? "

read whenvid;

if [ "$whenvid" = "now" ];

then

echo -n "video bitrate? (800?) ";

read vbr;

else

echo "waiting for video bitrate";

fi

echo -n "dvd title number? ";

read dvdtitle;

echo -n "press control-c when you know your crop settings.";

echo -n "You will know when the W:X:Y:Z numbers stay the same for a few seconds.";

echo "These are your crop settings.";

echo "hit enter to continue";

read blah;

mencoder -dvd $dvdtitle -sws 2 -ofps 23.976 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=800 -vop cropdetect,scale -zoom -xy 640 -oac copy -o getting.avi;

rm getting.avi;

echo -n "crop boundaries? ";

read crop;

echo "";

echo "now for the header:";

echo -n "title? ";

read title;

echo -n "artist? ";

read artist;

echo -n "genre? ";

read genre;

echo -n "year? ";

read year;

echo -n "comment? ";

read cmmnt;

echo -n "finally, file name? ";

read filename;

echo "thanks, I'm ripping to $filename. (you may want to check the language before the entire process completes)";

# pass 1

mencoder -dvd $dvdtitle -aid $lng -ofps 23.976 -ovc frameno -o frameno.avi -oac mp3lame -lameopts abr:br=$abr:vol=8;

if [ "$whenvid" = "now" ];

then echo "already got video bitrate";

else

echo -n "video bitrate?  ";

read vbr;

fi

# pass 2

mencoder -dvd $dvdtitle -sws 2 -info name="$title":artist="$artist":genre="$genre":copyright="$year":comment="$cmmnt" -ofps 23.976 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vqmin=2:vpass=1:vbitrate=$vbr -vop crop=$crop,scale -zoom -xy 640 -oac copy -o $filename;

# pass 3

mencoder -dvd $dvdtitle -sws 2 -info name="$title":artist="$artist":genre="$genre":copyright="$year":comment="$cmmnt" -ofps 23.976 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vqmin=2:vpass=2:vbitrate=$vbr -vop crop=$crop,scale -zoom -xy 640 -oac copy -o $filename;

echo ""

echo "done!";

echo "bitrate was: $abr for audio and $vbr for video.";

echo "cropped to $crop";

echo -n "clean up (yes/no)? ";

read cleanup;

if [ "$cleanup" = "yes" ];

then

rm frameno.avi;

rm divx2pass.log;

else

echo "";

fi

```

Last edited by guy on Mon Apr 07, 2003 2:48 pm; edited 1 time in total

----------

## Bonkie

nice script 

but i'm still looking for a script to rip subtitles from a DVD ...

----------

## kollega

Hi

Why don't you use dvd:rip? i think a very comfortable tool for ripping dvds!

----------

## guy

 *kollega wrote:*   

> Hi
> 
> Why don't you use dvd:rip? i think a very comfortable tool for ripping dvds!

 

I used it a while ago on RH-- it worked decently, but I felt I was getting better quality out of mencoder with their 3-pass rip. So I threw together a script that left the good little quality-boosting-rip-slowing things on and asked for bitrates and stuff. It also lets you specify the bitrate at the beginning if you think you know what you want, or wait until mencoder can give a very accurate reading of what to use for say a 700 meg file.

----------

## kollega

i'm not really fit in that ripping thing... *shame on me*

i just started some days ago ripping dvds to svcd... 

am i right that this script is used to rip into divx? or may i use it also for my svcd-stuff?

----------

## guy

 *kollega wrote:*   

> i'm not really fit in that ripping thing... *shame on me*
> 
> i just started some days ago ripping dvds to svcd... 
> 
> am i right that this script is used to rip into divx? or may i use it also for my svcd-stuff?

 

yea, sorry, should have mentioned that. It rips to divx.

----------

## telex4

*shamless plug*

Try QuickRip, a project of mine that might be what you're looking for. It's a DVD ripper written in Python that uses mencoder to do a 3-pass rip. Currently there's a PyQt interface implemented, which is really very easy to use, and I'm working atm on a CLI interface so it can be run without X up (I like to rip from the shell for speed).

Any suggestions for improvement, bug reports etc. are very welcome  :Smile: 

----------

## cerri

 *telex4 wrote:*   

> Any suggestions for improvement, bug reports etc. are very welcome

 

Here you are: the ebuild  :Smile: .

```
# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

inherit eutils

MY_PV="$(echo ${PV} | cut -d. -f1,2)"

S="${WORKDIR}/quickrip"

DESCRIPTION="Basic DVD ripper written in Python and PyQT."

SRC_URI="http://www.tomchance.uklinux.net/projects/quickrip-$MY_PV.tar.gz"

HOMEPAGE="http://www.tomchance.uklinux.net/projects/quickrip.shtml"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86 -ppc -mips"

RDEPEND="virtual/glibc

        >=dev-lang/python-2.2

        >=x11-libs/qt-3.1

        >=dev-python/PyQt-3.5

        media-video/mplayer

        media-video/transcode"

src_unpack() {

    unpack ${A}

}

src_install() {

        dodir /usr/share/quickrip

        into /usr/share/quickrip

        cp *.py *.ui README LICENSE /usr/share/quickrip

        dosym /usr/share/quickrip/quickrip.py quickrip

}

```

I'm testing it.

----------

## Harpalus

I have been using drip. It is in portage, works great

----------

## telex4

 *cerri wrote:*   

>  *telex4 wrote:*   Any suggestions for improvement, bug reports etc. are very welcome 
> 
> Here you are: the ebuild .

 

Cool  :Smile: 

----------

## cerri

I was unable to test it due to this bug.  :Sad: 

----------

## DefconAlpha

DVD::Rip works really well for me, even in the two-pass mode. It does subtitles (supposedly, never tested...), cropping, resizing, anti-aliasing and deinterlacing. It Just Works.

Can anyone notice the difference between two and three pass encoding? I'd be willing, to uh, "compare," differences if anyone can show me...

----------

## telex4

I assume 2-pass encoding does audio then video? 3 pass does audio, then video with logging, then video going over the log looking for quick movements and possible problems. I've only ever found one really noticeable glitch caught by 3-pass encoding, where a spike in CPU activity somehow caused a slight jump, and I'm either imagining it or rapid movements do seem slightly smoother with a 3-pass encode.

I like dvd::rip... it's just too damn complicated for normal use  :Smile: 

cerri... that's weird, and a shame... I have PyQt working fine with PyQt3.5 and Qt3.1.0-rc3. I've tried the ebuild and it doesn't work. I've managed to fix a few things, but for some reason it won't create the symlink, and I'm too tired atm to figure out why, so here's the amended ebuild:

```

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

inherit eutils

MY_PV="$(echo ${PV} | cut -d. -f1,2)"

S="${WORKDIR}/quickrip"

DESCRIPTION="Basic DVD ripper written in Python and PyQT."

SRC_URI="http://www.tomchance.uklinux.net/projects/quickrip-$MY_PV.tar.gz"

HOMEPAGE="http://www.tomchance.uklinux.net/projects/quickrip.shtml"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86 -ppc -mips"

RDEPEND="virtual/glibc

        >=dev-lang/python-2.2

        >=x11-libs/qt-3.1

        >=dev-python/PyQt-3.5

        media-video/mplayer

        media-video/transcode"

src_unpack() {

    unpack ${A}

}

src_install() {

        dodir /usr/share/quickrip

        into /usr/share/quickrip

        cp *.py *.ui README LICENSE ${D}/usr/share/quickrip

        dosym /usr/share/quickrip.py /usr/bin/quickrip

}

```

----------

## cerri

Sorry, a little error.

```
# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

inherit eutils

MY_PV="$(echo ${PV} | cut -d. -f1,2)"

S="${WORKDIR}/quickrip"

DESCRIPTION="Basic DVD ripper written in Python and PyQT."

SRC_URI="http://www.tomchance.uklinux.net/projects/quickrip-$MY_PV.tar.gz"

HOMEPAGE="http://www.tomchance.uklinux.net/projects/quickrip.shtml"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86 -ppc -mips"

RDEPEND="virtual/glibc

        >=dev-lang/python-2.2

        >=x11-libs/qt-3.1

        >=dev-python/PyQt-3.5

        media-video/mplayer

        media-video/transcode"

src_unpack() {

    unpack ${A}

}

src_install() {

        into /usr/share/quickrip

        dodir ${DESTTREE}

        cp *.py *.ui README LICENSE ${DESTTREE}

        dosym ${DESTTREE}/quickrip.py /usr/bin/quickrip

}
```

I hope it's correct, now  :Smile: 

----------

## telex4

That ebuild doesn't even manage to create /usr/share/quickrip! It gives me the following messages:

>>> Install quickrip-0.4 into /var/tmp/portage/quickrip-0.4/image/ category media-video

cp: copying multiple files, but last argument `/usr/share/quickrip' is not a directory

Try `cp --help' for more information.

ln: creating symbolic link `/var/tmp/portage/quickrip-0.4/image//usr/bin/quickrip' to `/usr/share/quickrip/quickrip.py': No such file or directory

man:

strip:

>>> Completed installing into /var/tmp/portage/quickrip-0.4/image/

----------

## cerri

```
# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

inherit eutils

MY_PV="$(echo ${PV} | cut -d. -f1,2)"

S="${WORKDIR}/quickrip"

D="/usr/share/quickrip"

DESCRIPTION="Basic DVD ripper written in Python and PyQT."

SRC_URI="http://www.tomchance.uklinux.net/projects/quickrip-$MY_PV.tar.gz"

HOMEPAGE="http://www.tomchance.uklinux.net/projects/quickrip.shtml"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86 -ppc -mips"

RDEPEND="virtual/glibc

        >=dev-lang/python-2.2

        >=x11-libs/qt-3.1

        >=dev-python/PyQt-3.5

        media-video/mplayer

        media-video/transcode"

src_unpack() {

    unpack ${A}

} 

src_install() {

        into /usr/share/quickrip

        mkdir ${D}

        cp *.py *.ui README LICENSE ${D}

        dosym /usr/bin/quickrip quickrip.py

}
```

The docs and the scripts are different. I think the docs are outdated (dodir isn't listed, but it does exist).

Anyway, I'm sorry but I was unable to test it.

----------

## telex4

You could always just remove the PyQt dependency and test the ebuid. And in about a week's time I should hopefully have v0.5 ready for release, with a CLI interface so you don't need PyQt  :Smile: 

----------

## cerri

Finally, it works.

```
# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

inherit eutils

MY_PV="$(echo ${PV} | cut -d. -f1,2)"

S="${WORKDIR}/quickrip"

DESCRIPTION="Basic DVD ripper written in Python and PyQT."

SRC_URI="http://www.tomchance.uklinux.net/projects/quickrip-$MY_PV.tar.gz"

HOMEPAGE="http://www.tomchance.uklinux.net/projects/quickrip.shtml"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86 -ppc -mips"

RDEPEND="virtual/glibc

        >=dev-lang/python-2.2

        >=x11-libs/qt-3.1

        >=dev-python/PyQt-3.5

        media-video/mplayer

        media-video/transcode"

src_unpack() {

    unpack ${A}

}

src_install() {

        insinto /usr/share/quickrip

        doins *.py *.ui README LICENSE

        fperms 755 $INSDESTTREE/cli.py $INSDESTTREE/dvd.py $INSDESTTREE/gui.py $INSDESTTREE/quickrip.py

        dodir /usr/bin

        dosym $INSDESTTREE/quickrip.py /usr/bin/quickrip

                                                                

}
```

----------

## telex4

Great  :Smile:  I've submitted the ebuild to bugzilla here  :Smile: 

----------

## cerri

 :Wink: 

----------

## mikepb78

Mencoder can do subtitle and various filters : 

```
 mencoder -sws 2 -aid 128 -oac mp3lame -lameopts br=96 

   -info name="Ninja Scrolls":artist="Michael    Brewer":genre="Anime":subject="action

   anime":srcform="DVD":comment="The DVD was heavily interlaced"

    -vobsubout ninja_scrolls_cd1 -vobsuboutindex 0 -sid 0 -vop

    scale=640:480,lavcdeint -ovc lavc -lavcopts

   vcodec=mpeg4:vhq:aspect=4/3:vbitrate=1600:v4mv:trell:keyint=125

   :vqmin=1:vqmax=8::vlelim=-4:vcelim=9:lumi_mask=0.05

   :dark_mask=0.01:::v4mv:vqblur=0.0:precmp=2:cmp=2

   :subcmp=2::vpass=1 -o ninja_scrolls_cd1.avi ninja_scrolls_1.vob
```

----------

## JoeG

just one comment...scripts ROCK....gui sucks.  I don't know about you guys(gals), but I type faster than I click.

my  2 cents

----------

## tam

 *telex4 wrote:*   

> It's a DVD ripper written in Python that uses mencoder to do a 3-pass rip. 

 

Hey, I miss an ebuild for stable 0.8   :Smile: 

----------

## telex4

The 0.8 ebuild went into gentoo's bug system a long time ago, and never came out  :Sad: 

See: https://bugs.gentoo.org/show_bug.cgi?id=25648

----------

## meulie

So... what is currently the best method to turn a DVD into a DivX on a CLI-system...?     :Cool: 

----------

## Lemma

 *guy wrote:*   

> Hi everybody, I wrote this little script to easily rip DVDs. Before you get started, you'll need to
> 
> ```
> 
> emerge lame
> ...

 I am having problem with the sound-sync, it is a bit off. I have had this problem before and the only way I know of that does not give me this problem is by using dvd::rip (or by using single-pass, and we do not want to do that, do we  :Wink: ), but then the ripping is very slow compared to a mplayer-script (even a 3-pass is a good portion faster) and dvd::rip is not CLI, something I prefer for it's flexibility. The quality of the rip is good, though  :Wink: .

Do any of you have this problem and if so, how do you solve it?

----------

## wjholden

Wow, this is what the open source is all about and when people ask me for how exactly open source development actually works I'm going to point them here so they can see something they might understand.  Thanks so much, I know nobody's even looked at this thread in a while but it's a beautiful thing nonetheless.

----------

## BlindSpy

great guide! cant wait to try it!

----------

## ezza

 *Bonkie wrote:*   

> nice script 
> 
> but i'm still looking for a script to rip subtitles from a DVD ...

 

Me to!, but I don't want them rendered onto the movie.

& I'm looking for something a little different to whats discussed here. While I was living in Tokyo, I bought some DVDs with Japans regional (price fixing) encoding & am now back in Australia where producers use a different regional encoding. I am in the process of removing the regional (price fixing) encodings from all my DVDs  *WITHOUT LOSS OF QUALITY* and burning the movie back to a DVD.

I can rip the vobs & decrypt them without resampling/encoding using a mixture of transcode & dvd::rip bits & pieces. I get the video stream & all the audio streams together, but I loose the subtitle streams. !!>_<!!  I can -vobsubout with mencoder but it takes ages because I can't seem to rip the subtitle stream without piping the whole video & audio stream to /dev/null or something. (I'm sure it used to be possible to get around that. There was some sort of null video & audio codec that doesn't seem to be there anymore.) Piping through the entire movie starts to get silly for a track with more than four subtitle streams. BELIEVE ME!

Anyway, this gets me to my problem. How do I get the vobsub output from mencoder back into the mpeg file? (without rendering)

Submux seems to use some crazy system with individual image files & it's input file is quite different from the timing output from mencoder. Is there some tool that magically just does it? Is there an easier way to get the subtitles in the AV output, without resampling & without loosing any audio or subtitle streams? Help!!!

START RANT

p.s. I HATE DRM & Copy Protection. I hate them with a passion. They don't stop pirates. They only frustrate people like me. I am a consumer. I bought these DVDs & the hassle that they've caused me is ridiculous. I just want to put them in my computer & watch them! Anywhere in the world! Region switching... regional price fixing, Grrrrr! At least Gentoo has allowed me watch my manga from hard disk. Sony... ...Grrrrr! I wont buy a sony product until they begin treating their customers with respect again!

END RANT

----------

## Mattwolf7

 *ezza wrote:*   

> I'm looking for something a little different to whats discussed here. While I was living in Tokyo, I bought some DVDs with Japans regional (price fixing) encoding & am now back in Australia where producers use a different regional encoding. I am in the process of removing the regional (price fixing) encodings from all my DVDs  *WITHOUT LOSS OF QUALITY* and burning the movie back to a DVD.
> 
> I can rip the vobs & decrypt them without resampling/encoding using a mixture of transcode & dvd::rip bits & pieces. I get the video stream & all the audio streams together, but I loose the subtitle streams. !!>_<!!  I can -vobsubout with mencoder but it takes ages because I can't seem to rip the subtitle stream without piping the whole video & audio stream to /dev/null or something. (I'm sure it used to be possible to get around that. There was some sort of null video & audio codec that doesn't seem to be there anymore.) Piping through the entire movie starts to get silly for a track with more than four subtitle streams. BELIEVE ME!
> 
> Anyway, this gets me to my problem. How do I get the vobsub output from mencoder back into the mpeg file? (without rendering)
> ...

 

The best way I have found to copy DVD's is using media-video/dvdbackup and this little script I wrote

```
#!/bin/sh

dvdbackup -n movie -M -i /dev/cdroms/cdrom0 -o /mnt/data/movies/dvd

mkisofs -dvd-video -o /mnt/data/movies/dvd/movie.iso /mnt/data/movies/dvd/movie

rm -r /mnt/data/movies/dvd/movie/

wine "C:\Program Files\DVD Shrink\DVD Shrink 3.2.exe"
```

Ofcourse you'll need to change the output directory and such but I think you are smart enough.

Using wine to run dvdshrink (which requires no setup) you then can import the .iso file created in line two and then dvdshrink will allow you to remove region encoding (and shrink the dvds to fit onto 4.7gb disks if you want.) Then I use k3b to burn the output from dvdshrink.

Some people have reported success in ripping from dvdshrink but i havent had any luck with that.

----------

## HeadHolio

Hi, I'm looking for a script or program that will rip a DVD using:

3 pass encoding

the newest xvid codec for video

ogg vorbis for audio

ogm as the container

Of course, I'd like to be able to specify bitrates and sizes.  Anyone know of such a beast?  The original script in this thread sounds good, but I prefer xvid/ogg over divx/lame.  Could it be easily altered?

----------

## bi3l

You can try OGMRip.

----------

## Lemma

 *HeadHolio wrote:*   

> Hi, I'm looking for a script or program that will rip a DVD using:
> 
> 3 pass encoding
> 
> the newest xvid codec for video
> ...

 DVD::rip does what you want, but it is not a script. What it is though is the best dvd-ripper I have found  :Very Happy: . Just emerge dvdrip and you're set to go.

----------

## fyreflyer

I hope this might help.  This is the script I use:

```
#! /bin/bash

mplayer -dumpstream -dumpfile $1.mpg -dvd-device /dev/sr0 dvd://
```

It takes a parameter of the name you want to dump  to in mpeg format.  Leave out the -dvd-device option if your dvd is /dev/dvd.

-fyreflyer

----------

## m707

[quote="ezza"] *Bonkie wrote:*   

> nice script 
> 
> but i'm still looking for a script to rip subtitles from a DVD ...

 

If your target is DVD again I would advise to use spuunmux to get the subs and spumux to render them back in.

Both belong to dvdauthor.

They use single pngs and a xml syntax for the step in between but who cares, if there is a temporary buch of pngs on the disc.

If you are looking for a native linux DVD9->DVD5 solution I would advise:

```
emerge lxdvdrip
```

Then get dvdwizzard:

http://www.wershofen.de/downloads/dvdwizard.tar.gz

and set it up (the default is quite ok). At present I use:

```

---/etc/lxdvdrip---

version=1.43

titel=0

videoformat=1

audio=3

faktor=-2

dvdleser=/dev/dvd

dvdbrenner=/dev/dvd

filmverzeichnis=/multimedia/dvd

file=0

brennprogramm=1

vobplayer=mplayer

vobplay_param="-vo sdl"

language=de

audio-default=1

streamtool=trans_par

wait-burn=1

tmp=/multimedia

delete=0

mplex=mplex

chapter=1

free=1

speed=4

dvdcompat=1

mkisofs_param=""

burn_param=""

burnkey=CDR_SECURITY=key_von_homepage_eintragen

eject=1

rw-format=1

dvdauthor_name=dvdauthor

streamdvd_name=streamdvd

streamanalyze_name=streamanalyze

buffer_name=buffer

#buffer_name=bfr

#buffer_name=mbuffer

tccat_name=tccat

tcextract_name=tcextract

tcrequant_name=tcrequant

mplayer_name=mplayer

mplex_name=mplex

tcmplex_name=tcmplex

spumux_name=spumux

spuunmux_name=spuunmux

dvdbackup_name=dvdbackup

mkisofs_name=mkisofs

cdrecord_prodvd_name=cdrecord-prodvd

growisofs_name=growisofs

dvd+rw-format=dvd+rw-format

dvdunauthor_name=dvdunauthor

tcprobe_name=tcprobe

vamps_name=vamps

eject_name=eject

mpgtx_name=mpgtx

transcode_name=transcode

lxac3scan_name=lxac3scan

dvdwizard=1

dvdwizard_name=/usr/local/bin/dvdwizard

#dvdwizard_bild1=/usr/share/vamps/penguin.jpg

#dvdwizard_bild2=/usr/share/vamps/penguin.jpg

---cut---

```

And it is generating a 9->5 backup, with IMHO quite nice audio and chapters (inkl. small previews of first chapter frame) selection menus.

The original menus are destroyed, but there is AFAIK no easy native linux solution to get this working (probably dvdunauthor will make this work ones or someone can try dvdbackup -> requant -> pgcedit, but it's IMHO still a pain).

OTOH the backups lxdvdrip can generate are quite nice and totally meet my requests.

I prefer to specify the sub tracks on my on as lsdvd/mplayer/tcprobe in some rare cases lie about the $LANG content. 

mplayer -sid [0-n] dvd://1

Schould give you more reliable information (mplayer sid cunt start at 0, lxdvd at 1).

I have several media-video tools at ~x86 and I suppose that these ones are needed:

```

---cut /etc/portage/packages.keywords---

media-video/lxdvdrip ~x86

media-video/dvdauthor ~x86

media-video/mjpegtools ~x86

media-video/ogle ~x86

media-video/transcode ~x86

media-video/vamps ~x86

--- cut ---

```

They will probably ask you to add some other packages to that list.

HTH

----------

## routerguy

Hi,

I am new to the DVD ripping scene here.  I am used to ripping my audio CDs to my 160 gigabyte hard-disc using abcde, cdparanoia, and flac.  I am looking to do something similar to do with DVDs.  If I am correct, DVDs are encoded with the MPEG-2 video codec.  Therefore, isn't reencoding them in another codec pretty degrading in quality?

Because I have quite a bit of space, I would like to know how to rip the DVDs, in their purest form and without loss in quality, to my hard-disc.  I don't want to use a GUI, I only want a CLI.  I basically want the raw video files in a nice folder so that I can watch it with mplayer.

Thanks.

----------

## m707

I would give dvdbackup a try, if you plan to get a HD archive.

You can play the files using:

mplayer -dvd-device /path/you/set/when/dvdbackuping dvd://1

or (better as menus are supported, too):

xine dvd:///path/you/set/when/dvdbackuping

or use ogles <open file>, IMHO best player for DVD on linux.

On dvd, there is quite some different content allowed, see:

https://forums.gentoo.org/viewtopic.php?p=2280563#2280563

OTOH on commercial DVDs you will hardly find anything else than 720x576[480] for the main title. Some

goodies ("Making of", "trailers" etc.), wil probably use the other formats, too.

To shrink a DVD 9 -> DVD 5 there are 2 possibilities availabe. The first and most common 

(as really fast - about 30 min.) is called requantization. Details:

http://www.ecse.rpi.edu/CNGV/publications/1998_PR/iab_talk_jw.pdf

in linux you use code developed by metakine:

http://www.metakine.com/

for MacOS X (and GPLed, as they use mjpeg-tools code in their product, too) for this step.

All tools you can use (requant, tcrequant, vamps) use this same code basis. 

The other opportunity is to recencode (takes about 6 hours on my Athlon 3k using mjpeg-tools - 

ffmpeg is quicker but I am not familiar with it and use requant anyhow-). However, it does not matter

which route you follow, your results will anyhow have to follow the standards allowed for DVD.

In spite from an theoretical point of view it is true that:

- each reencoding step will decrease quality

- re-encoding will give better results than requanting

you will IMHO hardly see any differences, if you keep reasonable options (don't requant with factors 

> 1.5, don't use bitrates < 6000 kbit/sec when reencoding).

The major problem with either step is not the quality, but the features of the dvd.

While it is rather easy to backup the main feature of a dvd:

mplayer -dumpstream -dumpfile video.mpg dvd://1

(supposing main feature is in titleset 1)

It is getting harder if you want to do DVD9to5 and save all features. Most tools do not support 

reqantisation of an mpeg programm stream (mpeg-ps), therefore you first have to split this

stream in elemetary streams (mpeg-es e.g. video, sound, subitles) and remux (glue them together)

again after requanting the video mpeg-es. 

In case of correct subtitle handling there is AFAIK no native linux-tool that will get the job done correctly 

in all situations.

However, the most disappointing point nowadays is that there is no native linux tool that can preserve the

original Menus and the structure. This is because a look in the DVD-standard is extremly expensive. There 

are some efforts to re-engeneer: 

http://www.dvd-replica.com/DVD/index.php

http://dvd.sourceforge.net/

and there are tools that can (probalby) assist like pgcedit:

http://home.tiscali.be/debie.roland/pgcedit/index.html

but it is still a real pain, and in no kind newbie compatible IMHO.

MS has a tool which runs under wine (dvdshrink), but I would prefer to keep my box wine-clean.

At the moment the best software to use is lxdvdrip (which combines mplayer, transcode, dvdauthor, vamps,

dvdbackup ...) I can create real nice 9to5 backups and (using dvdwizard) it will even create even some pretty 

(but not the original) menus to switch audio, or chapters.

The most prommissing approach OTOH is IMHO dvdunauthor -> requant -> dvdauthor, but still some

steps to take, to get this done rather smooth.

However, if you have a dvd that does not need any shrinking at all (very seldom at least for common material), 

you are fine with dvdbackup -> growisofs.

----------

## routerguy

Wow, thank you very much for the advice.  :Smile:  I do not have the time to go through the steps at the moment, but will do so as soon as I get time.  (Probably this weekend.)  The DVD menus do not matter to me; I only want the MPEG-2 video files extracted to a folder, so that I can easily view them with mplayer.  I know you talked about extracting the image and viewing it as if it were a disc, but ideally, I would simply like the MPEG-2 files.

I'm sorry if you already wrote about this, and like I said, I will analyize everything in more detail later.)

----------

## m707

 *Mystic0 wrote:*   

> 
> 
> I'm sorry if you already wrote about this, and like I said, I will analyize everything in more detail later.)

 

I probably was too involved in the process of making clean 9to5 in the last week and returned 

a liitle bit frustrated, so I had to write my frustation down  :Wink: .

To get your job done, just emerge dvdbackup. It will IMHO give you the solution you are looking for.

IIRC there is a undocumented '-n iso' option for dvdbackup, if you prefer to store the content as an image.

(mplayer can play this images directly for xine/ogle you have to loop mount) 

If you will only rip the main tiltle, I would suggest that you archive the results of following command lines:

```
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/,$//' > chapter.txt 
```

 [1]

and

```
ifo_dump /dev/dvd 1 | grep Color | sed 's/Color ..: 00//' > palette.txt
```

  [1]

together with the dvd-streams in one directory.

The first command line will store the timecodes, where the chapters change. The second will store the 

colour-palette, used for displaying subtitles. [2]

If you stay with your HD archive, you will hardly need this information. However if you ever decide to burn 

some stuff to dvd, you will appreciate to have archived that info and it only take a few bytes.

[1] tcprobe belongs to transcode and ifo_dump to ogle. The 1 in the lines stand for the first titleset on 

     the disc. In 80% the main feature is in titleset 1. If it is in a different titleset, just exchange the 1 

     by corresponding number.

[2] If you are a native english speaker you will probably think "I don't care about subtitles". But be

     careful. There are quite some DVD out that use subtitles to translate dialogues that are in strange

     languages (e.g. elvish in Lord of the rings, or some alien $LANG in Star Wars), stay in native $LANG

     for authentic reasons or which will simply give scene change informations (e.g. "London, 20 years

     later").

----------

## routerguy

Thank you!  :Very Happy: 

----------

## routerguy

Edit: This seems to be a common problem... sorry for posting before searching. :Embarassed:  

I am having a problem with ogle.  

I am able to watch Band of Brothers, discs 1, 2, 3, and 6, but discs 4 and 5 refuse to play.  Mplayer is able to play all of them, but does not have menu support.  I get the same results using either /dev/dvd, pointing to the disc, or using /path/to/ripped/disc.  (I ripped the whole disc, not just the main feature.)

Ogle plays a short intro, but dies right before going to the main menu.  (But only on discs 4 and 5!)  Here is the message:

```

bash-2.05b$ ogle /xtra/video/BAND_BROTHERS_D5/VIDEO_TS/

libdvdread: Using libdvdcss version 1.2.8 for DVD access

libdvdread: Couldn't find device name.

libdvdread: Using libdvdcss version 1.2.8 for DVD access

libdvdread: Couldn't find device name.

No accelerated IMDCT transform found

display: frame rate: 0.000 fps

ERROR[ogle_audio]: drain failed: Resource temporarily unavailable

ALSA lib pcm_hw.c:535:(snd_pcm_hw_prepare) SNDRV_PCM_IOCTL_PREPARE failed: Device or resource busy

ERROR[ogle_audio]: prepare failed: Device or resource busy

ALSA lib pcm_hw.c:382:(snd_pcm_hw_hw_free) SNDRV_PCM_IOCTL_HW_FREE failed: File descriptor in bad state

ERROR[ogle_audio]: Unable to set hw params for playback: File descriptor in bad state

ERROR[ogle_audio]: Setting of hwparams failed: File descriptor in bad state

FATAL[ogle_audio]: ogle_ao_init: 

ogle_audio: pcm.c:911: snd_pcm_delay: Assertion `pcm->setup' failed.

ctrl: ipc_rmid: Invalid argument

```

I am certain this is a problem with ogle, or the way I have configured ogle, and not dvdbackup.  I have not changed my oglerc at all.  I am using ALSA with 5.1 speakers.

I didn't know if I should have started a new thread or not, so I'm sorry if this is considered hijacking. :Sad: 

----------

## m707

I don't know the disc and never ran into issues using ogle. 

But probably a short test using xine (plays menus, too) could give a hint. 

As it seems to be a alsa/ogle problem you could try to tweak you oglerc to use 

oss-emulation ... might work.

----------

## routerguy

The problem is caused by media-libs/alsa-lib-1.0.7.  I upgraded to media-libs/alsa-lib-1.0.9_rc2-r1 and the problem disapeared.  However, I cannot completly recommend media-libs/alsa-lib-1.0.9_rc2-r1, because it has a bug with ogle where playback is way too fast.  You can easily work around it, however, by simply pressing r and jumping to the root menu, and the move is played back at a normal rate.  Maybe I should file a bug report?  Can anybody else reproduce this?  I am running a system that is less than a couple of weeks old, and am using conservative settings.  Regardless, ogle is working well enough now.

I am having a seperate but somewhat related problem with dvdbackup and a single DVD, "The Matrix".  dvdbackup successfully copies over about half of the movie, but then fails:

```

bash-2.05b$ dvdbackup -M -i /dev/dvd -o /xtra/video/

libdvdread: Using libdvdcss version 1.2.8 for DVD access

libdvdread: Attempting to retrieve all CSS keys

libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00036f47

libdvdread: Elapsed time 0

libdvdread: Get key for /VIDEO_TS/VTS_02_0.VOB at 0x00083f42

libdvdread: Elapsed time 0

libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x00095b04

libdvdread: Elapsed time 0

libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x00357b55

libdvdread: Elapsed time 0

libdvdread: Found 3 VTS's

libdvdread: Elapsed time 0

Error reading MENU VOB

Mirror of Title set 2 faild

Mirror of DVD faild

```

This seems to be a known problem, judging by the number of topics about it on these boards.  However, I have yet to come across a solution!  I have only found and tried two, both of which failed to solve the problem.  The first idea was to enable loopback support in the kernel, which has no effect.  The second idea is to enable DMA on the hard drive using hdparm, which has no effect.

This only happens on this particular disc; all of my other DVDs copy easily, without problem  Perhpas the disc is scratched?  Mplayer slows way down on the same spot when reading the disc in the drive.  :Sad: 

```

demux_mpg: 24fps progressive NTSC content detected, switching framerate.

a52: CRC check failed!  0.016 ct:  0.198  3424/3421  12% 13%  1.6% 10 0 0%%%

a52: error at resampling

a52: CRC check failed!  0.089 ct:  0.336  3490/3487  12% 13% 25.6% 55 0 0%

a52: error at resampling

a52: CRC check failed!  0.235 ct:  0.340  3491/3488  12% 13% 52.6% 56 0 0%

a52: error at resampling

a52: CRC check failed!  0.006 ct:  0.379  3504/3501  12% 13% 67.3% 60 0 0%

a52: error at resampling

A:  82.3 V:  82.0 A-V:  0.300 ct:  0.404  3510/3507  12% 13% 74.5% 65 0 0%

           ************************************************

           **** Your system is too SLOW to play this!  ****

           ************************************************

Possible reasons, problems, workarounds:

- Most common: broken/buggy _audio_ driver

  - Try -ao sdl or use ALSA 0.5 or the OSS emulation of ALSA 0.9.

  - Experiment with different values for -autosync, 30 is a good start.

- Slow video output

  - Try a different -vo driver (-vo help for a list) or try -framedrop!

- Slow CPU

  - Don't try to play a big DVD/DivX on a slow CPU! Try -hardframedrop.

- Broken file

  - Try various combinations of -nobps -ni -forceidx -mc 0.

- Slow media (NFS/SMB mounts, DVD, VCD etc)

  - Try -cache 8192.

- Are you using -cache to play a non-interleaved AVI file?

  - Try -nocache.

Read DOCS/HTML/en/devices.html for tuning/speedup tips.

If none of this helps you, read DOCS/HTML/en/bugreports.html.

```

And it gets so slow that it almost stops completly.  :Sad: 

In addition, ogle crashes when the same area is reached!

```

WARNING[ogle_mpeg_ps]: dvdreadblocks only got 176, wanted 233

FATAL[ogle_mpeg_ps]: dvdreadblocks failed

ctrl: ipc_rmid: Invalid argument

```

This leads me to believe that my disc is scratched.  :Crying or Very sad:  Maybe there is a way to skip the scratched part?  The ripped DVD file structure includes everything, including the menus, up to the point where it fails.  Maybe I can just copy the files over? :Question: 

----------

## m707

 *Mystic0 wrote:*   

> 
> 
> [Problems with matrix]
> 
> This leads me to believe that my disc is scratched.  Maybe there is a way to skip the scratched part?  The ripped DVD file structure includes everything, including the menus, up to the point where it fails.  Maybe I can just copy the files over?

 

No, unfortunately you can't. Its content is encrypted (css). The sectors with the css-keys are not that easy copyable.

As an alternative to dvdbackup, you could give cpdvd a try:

[url] http://www.lallafa.de/bp/cpdvd.html [/url]

it's offering various backends for ripping and is in portages ~$ARCH. However, most linux tools use libdvdread

which has some problems with "advanced DVD features".

I never tried 'the matrix', but I know from reading some lists, that it uses some rather tricky dvd features.

AFAIK the slowmotion, when Neo is avoiding the bullets is using angle changes. Angles are one of these

"advanced features". 

I only had to fight with angles once. The intro section of STAR_WARS, the yellow text scrolling on the screen,

is localized by using angles. In angle 1 is the english version on my german DVD. I spend a few hours to

find a tool that could rip the right German angle in this scene and paste it at the right position of the total rip 

with the english version, but after all I gave up and translated the part to  my children when whatching the copy  :Wink: .

However, this happend about 3 years ago, so hopefully the tools improved in the meantime.

If the problem is really a physical damage I would try dd-rescue at frist. It will not stop if there are damaged

sectors, but, it will toughly try to copy the sectors before giving up, so it should take some time.  OTOH I 

never tried it and I am not sure if it is able to copy the sectors with the css-keys, too.

If that fails, too. I would google for a cd/dvd polish set and try some craftsmanship  :Smile: . But probably buying a 

new version of Matrix will be the better invest. But before investing, you should make sure, that root of evil is 

a physical damage at all. Just try it in a DVD hardwarebox (not older than 4-5 years, as for some very old boxes

angle change problems are reported, too).

----------

## routerguy

Considering that it fails to play or rip at the same spot consistantly, it would make sense to conclude that it is indeed scrached.  Maybe I'll try renting a copy and see if it has the same problem.  If it doens't, I can use an electronic disc polisher I have that is known to either better or worsen the readability of the disc.  My last resort would be to buy it....

----------

## cazze

is there something like dvddecrypter on linux?

----------

## m707

No there isn't. I saw in the changelog that it is using dvdshrik and for some copy operations

that functionality is not 1:1 posible using native linux tools and get the job done within a 

reasonalbe time (see above), IMHO.

Further I don't know  whether all recent hardware(-features) are supported and DVD-RAM writing

is somewhat tricky AFAIK (might be solved in the meatime).

For all other topics I would try lxdvdrip, however, it's a command line tool. OTOH,  your tool is 

working as a wraper around a bunch of specialized tools (as I understood the changelog) and

that's the same with lxdvdrip.

----------

## selig

(I hope this is the right thread to post this...) I am having problems with subtitle sync. I have ripped the audio and video and created an OGM file which plays fine. But then I try to dump the vobsub subtitles with mencoder and they are out of sync! The source DVD had this "progressive NTSC content" feature, so I had to use -ofps 29.970 and -vf harddup while encoding it. And I cannot convert the subtitles to srt either, because they are too crappy for gocr to interpret them correctly. Any suggestions? I have tried dumping the subtitles with and without -ofps and harddup, but the result is just the same.

----------

## Xithix

Rip a dvd?

```
cat /dev/(dvd drive) > image.iso
```

----------

## Joseph_sys

 *telex4 wrote:*   

> *shamless plug*
> 
> Try QuickRip, a project of mine that might be what you're looking for. It's a DVD ripper written in Python that uses mencoder to do a 3-pass rip. Currently there's a PyQt interface implemented, which is really very easy to use, and I'm working atm on a CLI interface so it can be run without X up (I like to rip from the shell for speed).
> 
> Any suggestions for improvement, bug reports etc. are very welcome 

 

I just emerged quickrip, but it appears it doesn't work.

It did quick Audio pass +2-pass in 2sec. :-/

#Joseph

----------

## Mgiese

 *Harpalus wrote:*   

> I have been using drip. It is in portage, works great

 

your info is obsolete :

```
emerge -av drip

These are the packages that would be merged, in order:

Calculating dependencies \

emerge: there are no ebuilds to satisfy "drip".

```

----------

## yabbadabbadont

DVDFabHDDecrypter under WINE.  Works fine and it has yet to fail to backup a disc.

Edit: Holy Thread Necromancy Batman!

----------

## Mgiese

 *Xithix wrote:*   

> Rip a dvd?
> 
> ```
> cat /dev/(dvd drive) > image.iso
> ```
> ...

 

how to do that with a normal directory ?

```
 # cat /mnt/dvd > test.iso

cat: /mnt/dvd: Is a directory

```

----------

## vaticano666

 *Mgiese wrote:*   

> Rip a dvd?
> 
> ```
>  # cat /mnt/dvd > test.iso
> 
> ...

 

With :  

 dd if=/mnt/dvd of=test.iso

----------

## Mgiese

 *vaticano666 wrote:*   

>  *Mgiese wrote:*   Rip a dvd?
> 
> ```
>  # cat /mnt/dvd > test.iso
> 
> ...

 

odd, the same error occurs when trying your hint :

```
dd if=/mnt/dvd/  of=test.iso

dd: reading `/mnt/dvd/': Is a directory

0+0 records in

0+0 records out

0 bytes (0 B) copied, 0.000399142 s, 0.0 kB/s

```

----------

## chris.c.hogan

 *Mgiese wrote:*   

> 
> 
> ```
>  # cat /mnt/dvd > test.iso
> 
> ...

 

These commands work with device nodes, not directories. Change /mnt to /dev.

----------

