diff --git a/TOOLS/menc2pass b/TOOLS/menc2pass index d6b4bd138f..c52533fef3 100755 --- a/TOOLS/menc2pass +++ b/TOOLS/menc2pass @@ -9,11 +9,22 @@ my $mencoder="mencoder"; # Path to MEncoder (including binary name) die <<"EOF" unless @ARGV; Menc2Pass: No arguments given! Please give all usual encoding parameters you would give to mencoder, but leave -away the -pass switch. +away the pass= suboption. EOF for(my $i=1; $i<=2; $i++) { - system($mencoder,@ARGV," -pass $i") - and die "MEncoder pass $i failed!\n" + my $parm=""; + foreach my $val (@ARGV) { + if($val =~ /-lavcopts/) { + $parm.="$val vpass=$i:"; + } elsif($val =~ /-(divx4)|(xvid)opts/) { + $parm.="$val pass=$i:"; + } else { + $parm.="$val "; + } + } + print "Running $mencoder $parm\n"; + system($mencoder,$parm) + and die "MEncoder pass $i failed!\n" }