On Wed, 20 Aug 2008 04:46:02 GMT
Lysdestic <Lysdestic@no-mx.forums.opensuse.org> wrote:
>
> This seems easy enough.
>
> I have a DVD of a television show that I recently purchased that I want
> to back up as .avi files on my computer. At first I had some issues with
> Xvid encoding taking several hours for a 30min file, so I switched to
> MPEG-4 (DivX 4/5) and it takes about twenty minutes - problem solved.
>
> As it stands now, I am having to rip each title (episode) one at a
> time. Is there a way to rip them all at once and have each title
> (episode) save as separate files in one batch job?
>
> Thanks in advance.
>
>
I saw the other responses, figured I’d chime in with my own. Long ago I
wrote a little script to do this for me automagically…
It uses mplayer/mencoder (install it from packman), and two other tiny (very
useful!) scripts, range and ttshow. Give it the source and a name for the
files:
ripdvd /dev/sr3 “BluesClues”
will rip the DVD in /dev/sr3, naming each title “BluesClues_1.avi” and so on.
ripdvd DVDIMAGE.iso “Sex.in.the.City”
does the same, but from an image.
=====ripdvd==================================
#!/bin/bash
TTSHOW=’/usr/local/bin/ttshow’
RANGE=’/usr/local/bin/range’
if “x$2” = “x” ]; then
echo “Need dvd-device and filename”
exit 1;
fi
titles=mplayer -dvd-device "$1" dvd://1 -vo null -ao null -frames 0 -identify 2>/dev/null | grep "^ID_DVD_TITLES" | sed "s/ID_DVD_TITLES=//"
echo “Number of Titles: $titles”
$TTSHOW “$titles titles”
sleep 5
width=expr length "$titles"
Rips DVD to avi file
for a in $RANGE "$titles" 1 1 $width
; do
echo “--------”
echo “Chapter $a”
echo “--------”
$TTSHOW “($a) $2”
#mencoder -quiet -dvd-device “$1” dvd://$a -alang en -vf scale -zoom -xy
720 -ni -o “$2_$a.avi” -oac copy -ovc lavc -lavcopts vcodec=mpeg4 mencoder
-dvd-device “$1” dvd://$a -slang en -alang en -vf scale -zoom -xy 720 -ni -o
“$2_$a.avi” -oac copy -ovc lavc -lavcopts vcodec=mpeg4 done #
$TTSHOW “DONE - $2”
and then ttshow, this sends whatever follows the command to the title-bar of
the current terminal. VERY handy
ttshow hello
=====ttshow==================================
#!/bin/sh
echo -ne “\x1b]0;$*\x07”
and range… this takes a few arguments and outputs a sequence of numbers
based on that. Yes, I know about ‘seq’, wrote this years ago, it’s too handy
to throw out.
range 1 10 2
outputs
1 3 5 7 9
=====range==================================
#!/usr/bin/perl
use strict;
use warnings;
if ($#ARGV<0)
{ print "[lo] hi [skip] [width]
";
print "If not given: lo=1,skip=1,width=auto
";
exit 1;
}
my ($lo,$hi,$skip,$width,$out);
$lo=1;
$skip=1;
$width=0;
if (0==$#ARGV)
{ $hi=$ARGV[0]+0;
}
elsif ($#ARGV>0)
{ $lo=$ARGV[0]+0;
$hi=$ARGV[1]+0;
$skip=($ARGV[2]+0) if ($#ARGV>1);
$skip=1 if (0==$skip);
$skip=-$skip if (($lo>$hi)&&($skip>0));
$skip=-$skip if (($hi>$lo)&&($skip<0));
$width=($ARGV[3]+0) if ($#ARGV>2);
$width=0 if ($width<1);
}
while ((($lo<=$hi)&&($skip>0))||(($lo>=$hi)&&($skip<0)))
{ $out=$lo;
if ($width>0)
{ $out=substr(substr(“0"x$width,0,$width-1).(abs($lo)),-$width);
$out=”-".$out if ($lo<0);
}
print "$out
";
$lo=$lo+$skip;
}
Each needs to be saved as a separate text file, made executable, then placed
in your path somewhere. I usually put all three in /usr/local/bin/
Works VERY well, completely automated, updates title-bar to show status and
completion.
I made the ripper run backwards towards title 1 since that gives me a better
idea of how long it’s got left, and while it’s chewing on the (usually) large
title 1 (the main movie), I can watch all the little ‘behind the scenes’ and
blooper reels.
Loni
And yes, I like Blue’s Clues… well, up until Steve had to go and Joe took
his place. Joe’s a putz. And baby Paprika is SOOO cute!
–
L R Nix
lornix@lornix.com