View previous topic :: View next topic |
Author |
Message |
guy Apprentice
Joined: 31 Mar 2003 Posts: 286 Location: USA
|
Posted: Sun Apr 06, 2003 4:49 pm Post subject: Rip a DVD |
|
|
Hi everybody, I wrote this little script to easily rip DVDs. Before you get started, you'll need to
Code: |
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!
Code: |
#! /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 |
|
Back to top |
|
|
Bonkie Guru
Joined: 28 Oct 2002 Posts: 501 Location: Antwerpen, Belgium
|
Posted: Sun Apr 06, 2003 7:20 pm Post subject: |
|
|
nice script
but i'm still looking for a script to rip subtitles from a DVD ... |
|
Back to top |
|
|
kollega Tux's lil' helper
Joined: 19 Jul 2002 Posts: 127 Location: Munich, Germany
|
Posted: Mon Apr 07, 2003 9:25 am Post subject: |
|
|
Hi
Why don't you use dvd:rip? i think a very comfortable tool for ripping dvds! |
|
Back to top |
|
|
guy Apprentice
Joined: 31 Mar 2003 Posts: 286 Location: USA
|
Posted: Mon Apr 07, 2003 2:46 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
kollega Tux's lil' helper
Joined: 19 Jul 2002 Posts: 127 Location: Munich, Germany
|
Posted: Mon Apr 07, 2003 9:20 pm Post subject: |
|
|
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? |
|
Back to top |
|
|
guy Apprentice
Joined: 31 Mar 2003 Posts: 286 Location: USA
|
Posted: Tue Apr 08, 2003 4:37 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
telex4 l33t
Joined: 21 Sep 2002 Posts: 704 Location: Reading, UK
|
Posted: Tue Apr 08, 2003 6:02 pm Post subject: |
|
|
*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 |
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Tue Apr 08, 2003 6:54 pm Post subject: |
|
|
telex4 wrote: | Any suggestions for improvement, bug reports etc. are very welcome |
Here you are: the ebuild .
Code: | # 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. _________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
Harpalus n00b
Joined: 16 Oct 2002 Posts: 26
|
Posted: Tue Apr 08, 2003 8:44 pm Post subject: |
|
|
I have been using drip. It is in portage, works great |
|
Back to top |
|
|
telex4 l33t
Joined: 21 Sep 2002 Posts: 704 Location: Reading, UK
|
Posted: Tue Apr 08, 2003 9:19 pm Post subject: |
|
|
cerri wrote: | telex4 wrote: | Any suggestions for improvement, bug reports etc. are very welcome |
Here you are: the ebuild . |
Cool |
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Tue Apr 08, 2003 9:30 pm Post subject: |
|
|
I was unable to test it due to this bug. _________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
DefconAlpha Apprentice
Joined: 25 Feb 2003 Posts: 151 Location: Alabama
|
Posted: Tue Apr 08, 2003 9:45 pm Post subject: DVD::Rip |
|
|
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... _________________ In the end, the love you get is equal to the love you make
--John Lennon & Paul McCartney (The End - Abbey Road, |
|
Back to top |
|
|
telex4 l33t
Joined: 21 Sep 2002 Posts: 704 Location: Reading, UK
|
Posted: Tue Apr 08, 2003 11:10 pm Post subject: |
|
|
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
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:
Code: |
# 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
}
|
|
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Wed Apr 09, 2003 6:16 am Post subject: |
|
|
Sorry, a little error.
Code: | # 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 _________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
telex4 l33t
Joined: 21 Sep 2002 Posts: 704 Location: Reading, UK
|
Posted: Wed Apr 09, 2003 9:54 am Post subject: |
|
|
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/ |
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Wed Apr 09, 2003 2:13 pm Post subject: |
|
|
Code: | # 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. _________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
telex4 l33t
Joined: 21 Sep 2002 Posts: 704 Location: Reading, UK
|
Posted: Wed Apr 09, 2003 5:27 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Wed Apr 09, 2003 7:25 pm Post subject: |
|
|
Finally, it works. Code: | # 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
} |
_________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
telex4 l33t
Joined: 21 Sep 2002 Posts: 704 Location: Reading, UK
|
Posted: Wed Apr 09, 2003 11:36 pm Post subject: |
|
|
Great I've submitted the ebuild to bugzilla here |
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Thu Apr 10, 2003 5:21 am Post subject: |
|
|
_________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
mikepb78 Apprentice
Joined: 27 Feb 2003 Posts: 171 Location: London
|
Posted: Sat Apr 12, 2003 2:37 pm Post subject: Mencoder can also do Subtitles and can do some nice filters |
|
|
Mencoder can do subtitle and various filters :
Code: | 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 |
|
|
Back to top |
|
|
JoeG Apprentice
Joined: 30 Jul 2003 Posts: 179 Location: Kentucky, USA
|
Posted: Wed Aug 06, 2003 3:37 pm Post subject: |
|
|
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 _________________ Linux User#226477 |
|
Back to top |
|
|
tam Guru
Joined: 04 Mar 2003 Posts: 569
|
Posted: Fri Aug 29, 2003 6:38 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
telex4 l33t
Joined: 21 Sep 2002 Posts: 704 Location: Reading, UK
|
|
Back to top |
|
|
meulie l33t
Joined: 17 Jun 2003 Posts: 845 Location: a Dutchman living in Norway
|
Posted: Wed May 19, 2004 11:08 pm Post subject: |
|
|
So... what is currently the best method to turn a DVD into a DivX on a CLI-system...? _________________ Greetz,
Evert Meulie |
|
Back to top |
|
|
|