2 # Helper script to ease MEncoder two pass encoding
3 # Copyleft 2001 by Felix Buenemann <atmosfear@users.sourceforge.net>
4 # This file comes under GPL, see http://www.gnu.org/copyleft/gpl.html for more
5 # information on it's licensing.
7 my $mencoder="mencoder"; # Path to MEncoder (including binary name)
9 die <<"EOF" unless @ARGV;
10 Menc2Pass: No arguments given!
11 Please give all usual encoding parameters you would give to mencoder, but leave
12 away the pass=<n> suboption.
15 for(my $i=1; $i<=2; $i++) {
17 foreach my $val (@ARGV) {
18 if($val =~ /-lavcopts/) {
19 $parm.="$val vpass=$i:";
20 } elsif($val =~ /-(divx4)|(xvid)opts/) {
21 $parm.="$val pass=$i:";
26 print "Running $mencoder $parm\n";
27 system($mencoder,$parm)
28 and die "MEncoder pass $i failed!\n"