FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-25-2009, 05:40 AM
Ron Johnson
 
Default Handy functions for ripping movies

Hi,

While ripping a bunch of (legal!) DVDs, I came up with these bash
functions to make the task simpler. Hope you find it useful someday.


You'll, of course, have to modify the DEST & TARGET values to suit
your own organizational theories. For me, movies and tv shows go in
separate directories


$ get_movie Jungle_Book_(1942)

$ get_movie Love_Crazy

$ get_video tv/z__movies 1 Halloweentown

$ get_video movies 1 Captain_Kidd

$ get_video movies 2 King_Solomon's_Mines

$ pwd
/data/big/video

$ dir
total 233272
drwxr-xr-x 6 me people 4096 2009-01-25 00:25 ./
drwxr-xr-x 8 root people 4096 2009-01-23 09:39 ../
drwxr-xr-x 8 me people 4096 2008-08-03 15:46 anime/
drwxr-xr-x 12 me people 12288 2009-01-25 00:31 movies/
drwxr-xr-x 10 me people 4096 2009-01-24 16:06 shorts/
drwxr-xr-x 45 me people 4096 2009-01-25 00:30 tv/

######### Begin scripts ############

calc() { perl -e "print '.($*)."
""; }

get_video ()
{
TYPE=${1}
TITLE_NUM=${2}
NAME=${3}
DVD=/dev/scd0
DEST=/data/big/video/${TYPE}
TARGET=${DEST}/${NAME}.mpeg
ls ${TARGET} 2> /dev/null > /dev/null
rc=$?
if [ ${rc} -eq 0 ];
then
echo ${TARGET} "exists";
return $rc;
fi
echo ${TARGET}
/usr/bin/time -f "%e" -o /tmp/elapsed.txt
mplayer -dvd-device $DVD dvd://${TITLE_NUM}
-dumpstream -dumpfile ${TARGET}
num_secs=$(cat /tmp/elapsed.txt)
file_size=$(stat -c%s ${DEST}/${NAME}.mpeg)
echo ${num_secs} "seconds"
echo ${file_size} "bytes"
MBps=$(calc ${file_size}/${num_secs}/1024/1024)
echo $MBps "MB/sec"
}

get_movie ()
{
eject -T $DVD
sleep 2s
get_video movies 1 ${1}
eject $DVD
}

######### End Scripts ############

--
Ron Johnson, Jr.
Jefferson LA USA

"I am not surprised, for we live long and are celebrated poopers."


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-26-2009, 10:40 PM
Alex Samad
 
Default Handy functions for ripping movies

On Sun, Jan 25, 2009 at 12:40:28AM -0600, Ron Johnson wrote:
> Hi,
>
> While ripping a bunch of (legal!) DVDs, I came up with these bash
> functions to make the task simpler. Hope you find it useful someday.
>

[snip]

wouldn't actually say you are ripping, more coping


I use something like this
BITRATE=${BITRATE:-1000}


# New from readnig the web page!
PASSCOMMON='subq=6artitions=all:8x8dct:frameref= 3:b_pyramid:me=umh:bframes=4:weight_b:nopsnr:threa ds=auto:brdo:trellis=1:level_idc=41
:direct_pred=auto:bime'


PASS1='pass=1:turbo=1'
PASS2='pass=2'

ENC1="x264 -x264encopts $PASS1:$PASSCOMMON:bitrate=$BITRATE"
ENC2="x264 -x264encopts $PASS2:$PASSCOMMON:bitrate=$BITRATE"


# setup Video filtering
CROP=${CROP:-"crop=720:416:0:80"}
FILTERCOMMN=${FILTERCOMMN:-'harddup'}
FILTER1=${FILTER1:-"$CROP,$FILTERCOMMN"}
FILTER2=${FILTER2:-"$CROP,$FILTERCOMMN"}

OUTF="$OUTD/$BASE.avi"
PASSLOG="$BASE.divx2pass.log"



echo "Pass 1"
nice mencoder -quiet
-vf $FILTER1
-ovc $ENC1
-oac "$OAC" $OACOPT
-passlogfile "$PASSLOG"
-o /dev/null
"$INF" $ADDOPT $AID $DVDDEVICE $OFPS

echo "Pass 2"
nice mencoder -quiet
-vf $FILTER2
$AENC
-ovc $ENC2
-passlogfile "$PASSLOG"
-oac "$OAC" $OACOPT
-o "$TMPF"
"$INF" $ADDOPT $AID $DVDDEVICE $OFPS

takes more time, but uses a lot less space


>
> --
> Ron Johnson, Jr.
> Jefferson LA USA
>
> "I am not surprised, for we live long and are celebrated poopers."
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a
> subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
"September the 4th 2001, I stood in the ruins of the Twin Towers. It's a day I will never forget."

- George W. Bush
10/18/2004
Marlton, NJ
in a campaign speech
 
Old 01-27-2009, 12:07 AM
Ron Johnson
 
Default Handy functions for ripping movies

On 01/26/2009 05:40 PM, Alex Samad wrote:

On Sun, Jan 25, 2009 at 12:40:28AM -0600, Ron Johnson wrote:

Hi,

While ripping a bunch of (legal!) DVDs, I came up with these bash
functions to make the task simpler. Hope you find it useful someday.




[snip]

wouldn't actually say you are ripping, more coping


Ripping is pulling audio/video off of CD/DVD. Has nothing to do
with compression.


I use something like this
BITRATE=${BITRATE:-1000}



# New from readnig the web page!


Which page?


PASSCOMMON='subq=6artitions=all:8x8dct:frameref= 3:b_pyramid:me=umh:bframes=4:weight_b:nopsnr:threa ds=auto:brdo:trellis=1:level_idc=41
:direct_pred=auto:bime'


PASS1='pass=1:turbo=1'
PASS2='pass=2'

ENC1="x264 -x264encopts $PASS1:$PASSCOMMON:bitrate=$BITRATE"
ENC2="x264 -x264encopts $PASS2:$PASSCOMMON:bitrate=$BITRATE"


How tightly does this compress?

(Disks are cheap enough that, while I do want *some* compression, I
will "spend" space for quality. This is so that if I ever want/need
to burn them to DVD in the future, they will still look good.)



# setup Video filtering
CROP=${CROP:-"crop=720:416:0:80"}


Why?


FILTERCOMMN=${FILTERCOMMN:-'harddup'}
FILTER1=${FILTER1:-"$CROP,$FILTERCOMMN"}
FILTER2=${FILTER2:-"$CROP,$FILTERCOMMN"}

OUTF="$OUTD/$BASE.avi"
PASSLOG="$BASE.divx2pass.log"



echo "Pass 1"
nice mencoder -quiet
-vf $FILTER1
-ovc $ENC1
-oac "$OAC" $OACOPT
-passlogfile "$PASSLOG"
-o /dev/null
"$INF" $ADDOPT $AID $DVDDEVICE $OFPS

echo "Pass 2"
nice mencoder -quiet
-vf $FILTER2
$AENC
-ovc $ENC2
-passlogfile "$PASSLOG"
-oac "$OAC" $OACOPT
-o "$TMPF"
"$INF" $ADDOPT $AID $DVDDEVICE $OFPS

takes more time,


dumpstream, though, is *fast*.


but uses a lot less space


But how much information do you lose? With dumpstream, you lose
none. Gives me a chance then to go back and experiment with
differing compression levels.


I will, though, try these, once I rip all my disks.

--
Ron Johnson, Jr.
Jefferson LA USA

"I am not surprised, for we live long and are celebrated poopers."


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-27-2009, 05:37 AM
Alex Samad
 
Default Handy functions for ripping movies

On Mon, Jan 26, 2009 at 07:07:43PM -0600, Ron Johnson wrote:
> On 01/26/2009 05:40 PM, Alex Samad wrote:
>> On Sun, Jan 25, 2009 at 12:40:28AM -0600, Ron Johnson wrote:
>>> Hi,
>>>
>>> While ripping a bunch of (legal!) DVDs, I came up with these bash
>>> functions to make the task simpler. Hope you find it useful someday.
>>>
>>
>> [snip]
>>
>> wouldn't actually say you are ripping, more coping
>
> Ripping is pulling audio/video off of CD/DVD. Has nothing to do with
> compression.
>
>> I use something like this BITRATE=${BITRATE:-1000}
>>
>>
>> # New from readnig the web page!
>
> Which page?
oops bad copy/paste - mainly from mplayer site

>
>> PASSCOMMON='subq=6artitions=all:8x8dct:frameref= 3:b_pyramid:me=umh:bframes=4:weight_b:nopsnr:threa ds=auto:brdo:trellis=1:level_idc=41
>> :direct_pred=auto:bime'
>>
>>
>> PASS1='pass=1:turbo=1'
>> PASS2='pass=2'
>>
>> ENC1="x264 -x264encopts $PASS1:$PASSCOMMON:bitrate=$BITRATE"
>> ENC2="x264 -x264encopts $PASS2:$PASSCOMMON:bitrate=$BITRATE"
>
> How tightly does this compress?
>
> (Disks are cheap enough that, while I do want *some* compression, I will
> "spend" space for quality. This is so that if I ever want/need to burn
> them to DVD in the future, they will still look good.)

depends I find 1000kb is pretty good to dvd quaity

>
>> # setup Video filtering
>> CROP=${CROP:-"crop=720:416:0:80"}
>
> Why?

bad copy paste, I need to crop for that job, somebody had encoded with
black bars

>
>> FILTERCOMMN=${FILTERCOMMN:-'harddup'}
>> FILTER1=${FILTER1:-"$CROP,$FILTERCOMMN"}
>> FILTER2=${FILTER2:-"$CROP,$FILTERCOMMN"}
>>
>> OUTF="$OUTD/$BASE.avi"
>> PASSLOG="$BASE.divx2pass.log"
>>
>>
>>
>> echo "Pass 1"
>> nice mencoder -quiet
>> -vf $FILTER1
>> -ovc $ENC1
>> -oac "$OAC" $OACOPT
>> -passlogfile "$PASSLOG"
>> -o /dev/null
>> "$INF" $ADDOPT $AID $DVDDEVICE $OFPS
>>
>> echo "Pass 2"
>> nice mencoder -quiet
>> -vf $FILTER2
>> $AENC
>> -ovc $ENC2
>> -passlogfile "$PASSLOG"
>> -oac "$OAC" $OACOPT
>> -o "$TMPF"
>> "$INF" $ADDOPT $AID $DVDDEVICE $OFPS
>>
>> takes more time,
>
> dumpstream, though, is *fast*.

yeah, but you could also use vobcopy and make a backup of the dvd, thus
keep multi tracks and subtitles ...

>
>> but uses a lot less space
>
> But how much information do you lose? With dumpstream, you lose none.
> Gives me a chance then to go back and experiment with differing
> compression levels.
>
> I will, though, try these, once I rip all my disks.

I have found there are really any set values to use, try some and see
how it goes depends on the movie you started with. But from what I have
seen/read 2 pass encoding is the way to go if you are worried about size

>
> --
> Ron Johnson, Jr.
> Jefferson LA USA
>
> "I am not surprised, for we live long and are celebrated poopers."
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a
> subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
"That's called, 'A Charge To Keep,' based upon a religious hymn. The hymn talks about serving God. The president's job is never to promote a religion."

- George W. Bush
05/05/2006
Washington, DC
talking to a German newspaper reporter in the Oval Office
 
Old 01-27-2009, 05:58 AM
Ron Johnson
 
Default Handy functions for ripping movies

On 01/27/2009 12:37 AM, Alex Samad wrote:

On Mon, Jan 26, 2009 at 07:07:43PM -0600, Ron Johnson wrote:

On 01/26/2009 05:40 PM, Alex Samad wrote:

[snip]


depends I find 1000kb is pretty good to dvd quaity


Good.


# setup Video filtering
CROP=${CROP:-"crop=720:416:0:80"}

Why?


bad copy paste, I need to crop for that job, somebody had encoded with
black bars


Ah.



yeah, but you could also use vobcopy and make a backup of the dvd, thus


Or mount and cp. But I'll have to try out vobcopy for commercial DVDs


keep multi tracks and subtitles ...


All of the disks that I'm ripping this way are created from Turner
Classic Movies and my DVR's built-in burner.


--
Ron Johnson, Jr.
Jefferson LA USA

"I am not surprised, for we live long and are celebrated poopers."


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 05:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org