[MPlayer-users] how to evaluate ripped dvd size

D Richard Felker III dalias at aerifal.cx
Fri Sep 13 17:35:02 CEST 2002


On Fri, Sep 13, 2002 at 03:06:17PM +0100, Chris Phillips wrote:
  .
  .
  .
> foreach (@ifolist) {
>   $IFO=$_; s/ifo/vob/; $VOB=$_;
> 
>   foreach (`vstrip $DVD/video_ts/$VOB -i $DVD/video_ts/$IFO`) {
>     if (grep {/MPEG2 720/} $_) {
>       /(NTSC|PAL) (.*):/;
>       if ($2==4) {$as=480;}
>       elsif ($2==16) {$as=360;}
>       else {print "$1, no aspect found, assuming widescreen\n"; $as=360;}
>     } elsif (grep {/Length/} $_) {
>       $t++;
>       /([0-9]).*Length: (.*):(.*):(.*):/ ;
>       $l=((($2*60)+$3)*60)+$4;
>       if ($l>$LENGTH||$t==1) {$TRACK=$t; $LENGTH=$l; $ASPECT="-vop scale=640:$as";}
> } } }
> 
> if ($mount==1) {system "umount", $DVD;}
> 
> $INPUT="-dvd $TRACK";
> $BR="abr";
> $BITRATE=int(5734400/$LENGTH)-128;
> $LAVC="-ovc lavc -lavcopts vcodec=mpeg4:vhq:vqmin=2:vbitrate=$BITRATE";
> $MP3="-oac mp3lame -lameopts $BR:br=128";
> $AID="-aid 128";
> 
> exec "mencoder $LAVC $MP3 $INPUT $AID $ASPECT -o $FILE\n";

If you're really going to use this rather than manually figuring out
the options for each encode, you should integrate automatic crop
detect and cropping. Otherwise you will waste lots of bits on failed
motion estimation and sharp discontinuities at the image->black
transition lines, greatly reducing the quality. Also you should make
sure that the image dimensions after cropping remain multiples of 16,
or at least of 8.

Rich




More information about the MPlayer-users mailing list