You are here: Re: Automated DVD-ripping process w/Linux « Video DVD Forum « DVD MP3 AVI MP4 players codecs conversion help
Re: Automated DVD-ripping process w/Linux

Posted by Losher Ooka on 05/01/07 21:30

On 2007-04-28, Wendell III <wendell.iii@gmail.com> wrote:
> Hi all,
>
> I am looking for a way to make my headless Linux box auto-detect
> DVD-video upon insert into a drive, proceed with a ripping process, and
> then an H.264 encoding process. Basically, I'm looking for a solution
> where I have to do nothing but insert the disc.
>
> Any suggestions on how to proceed? Obivously the latter parts are
> easier if I can figure out the former...
>
> Cheers,
> -Wendell

If you can script, it's easy enough to write a shell/perl/whatever
script that runs in the background and examines the drive
periodically. When it finds a DVD video inserted, it rips it to the
hard drive, and then transcodes it.

Actually, the hardest part, as someone has already pointed out, is
that there's really no standard arrangment of titles on DVDs, so it's
hard to fully automate the encoding -- simply choosing the longest
title in it's primary language is the usual heuristic and generally
works ok on movie DVDs, but like all heuristics will occasionally do
completely the wrong thing, failing miserably on e.g. episodic dvds
(i.e. ones containing a bunch of TV episodes).

That said, you might cobble together, for example, a script using:

1) dvd+rw-mediainfo to see if the drive is loaded

2) lsdvd to print information about a video-DVD including the longest track

3) tccat (or vobcopy or dvdbackup) to rip DVD titles to the hard drive

4) mencoder to do the encoding.

So something like:

#! /bin/sh

dev=/dev/hdb

while true; do
# sleep 15 minutes
sleep 900

# anything in the dvd drive?
dvd+rw-mediainfo $dev
if [ $? != 0 ]; then
eject $dev
continue
fi

# find the longest title/chapter
longest=`lsdvd $dev | egrep -i longest | sed 's/.*: //'`

# extract the longest title/chapter
tccat -T $longest,-1 -i $dev > $longest.vob

# encode, pass1
nice -n +19 mencoder -oac copy -o /dev/null -ovc lavc -lavcopts \
vcodec=mpeg4:vbitrate=950:vhq:autoaspect:vpass=1 $longest.vob

# encode, pass2
nice -n +19 mencoder -oac copy -o $longest.avi -ovc lavc -lavcopts \
vcodec=mpeg4:vbitrate=950:vhq:autoaspect:vpass=2 $longest.vob

# delete the ripped title/chapter to save space
rm $longest.vob

# eject the disk
eject $dev
done

Cheers,

Losher

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  статьи на английском  •  England, UK  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  IT news, forums, messages
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites
Разработано в студии "Webous"