[MPlayer-users] how to evaluate ripped dvd size

Chris Phillips chris at thirtythreeandathird.net
Fri Sep 13 16:30:02 CEST 2002


i don't *think* i actually edited anything relevant, just compiled it in 
the actual source directory with something like

gcc main.c vstrip.c parse_ifo.c in_buffer.c file_io.c -D__UNIX__ -lm

i've attached my perl script which will find the main title in any dvd and 
auto rip it if it's of any interest to you. still being written of course.

> can you mail me your edited sources, so I can get it to compile too, or maybe 
> the compiled vstrip ? I would really like to play around with it.
> 
> Greats 
> 
> Steffen

-------------- next part --------------
#!/usr/bin/perl

$DVD="/mnt/dvd";
$t=0;

if (@ARGV) {$FILE="$ARGV[0].avi";} 
else {
  print "no file name specified! using rip.avi\n";
  $FILE="rip.avi";
}

if (! opendir(DIR,"$DVD/video_ts")) {
  if (! system "mount $DVD 2> /dev/null") {$mount=1;} 
  if (! opendir(DIR,"$DVD/video_ts")) {
    die "Can't find video_ts. is there a DVD in the drive?\n";
} }


@ifolist=grep {/vts.*ifo/} readdir(DIR);
closedir(DIR);

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";


More information about the MPlayer-users mailing list