[MPlayer-users] how to evaluate ripped dvd size

Chris Phillips chris at thirtythreeandathird.net
Mon Sep 9 12:21:02 CEST 2002


I wrote a simple shell script to make it all a lot quicker and fast to use 
mencoder, which will automatically calculate a bitrate based on the 
length of the film. There's no decent way to automatically find out how 
long a title is though, esp as the timing on the dvd can jump about about 
(e.g. resets to 0 4 times during Monsters Inc) so I just write down all 
the lengths of a film, and add them together, chopping off the credits 
sometimes too, and jus use that as a parameter for the script below. It 
automatically uses 128kbps mp3 audio, and so takes that away from the 
video bandwith, making the end film always between sat 670mb and 700mb. 
Also as the audio is abr by default that will make it err on the smaller 
side too.

Certainly would be nice if there was an easier way to A) find the main 
title of a dvd - I did have a working solution which mounted a dvd and 
found the biggest set of vob files and go from there, but so many films 
now put more that one title in a vob or something (Monsters inc vas 14 
sets of vobs, but the film is title number 26) and B) find the length of a 
film... i don't think there's really that much that could be done for them 
in just a wrapper script though.

chris
xxxx

#!/bin/sh

if [ $# -eq "0" ]
then
  echo "Usage: `basename $0` -a AID -b [CBR] -n [4x3] [ -d DVD | -f file ] 
-l LENGTH -o OUTPUT"
  exit 1
fi

LENGTH=-1
ASPECT='-vop scale=640:360'
BR=abr
AID="-aid 128"

while getopts "ancl:d:f:o:s:" Option
do
  case $Option in
    a ) AID="-aid $OPTARG";;
    n ) ASPECT="-vop scale=640:480";;
    c ) BR=cbr;;
    l ) LENGTH=$OPTARG;;
    d ) INPUT="-dvd $OPTARG";;
    f ) INPUT="$OPTARG";;
    o ) FILE="-o $OPTARG.avi";;
    s ) START="-ss $OPTARG";;
    * ) echo "Unimplemented option chosen.";;
  esac
done

BITRATE=$(((5734400 / $LENGTH) - 128))
LAVC="-ovc lavc -lavcopts vcodec=mpeg4:vhq:vqmin=2:vbitrate=$BITRATE"
MP3="-oac mp3lame -lameopts "$BR":br=128"
END="-endpos $((LENGTH+20))"

echo Ripping DVD with MEncoder:
echo DVD title - $DVD
echo Film length - $LENGTH
echo Filename - $FILE
echo

echo running - mencoder $LAVC $MP3 $INPUT $AID $START $ASPECT $END $FILE
mencoder $LAVC $MP3 $INPUT $AID $START $ASPECT $END $FILE

shift $(($OPTIND - 1))

exit 0

> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi,
> I am starting using mencoder to rip my DVDs and I wonder if there is any 
> way to evaluate
> in advance the size of an avi file ripped from a dvd as function of the 
> bitrate and/or of the
> resolution you are using.
> Actually, it would be extremely nice if you could get separately the 
> size of the video and
> of the audio, since some previous email taught us how to stuff multiple 
> audio tracks in the
> same avi.
> Any help would be greatly appreciated.
>  Roberto De Leo
> 
> 
> _______________________________________________
> RTFM!!!  http://www.MPlayerHQ.hu/DOCS
> Search:  http://www.MPlayerHQ.hu/cgi-bin/htsearch
> http://mplayerhq.hu/mailman/listinfo/mplayer-users
> 




More information about the MPlayer-users mailing list