3024
|
1 #!/usr/bin/perl -w
|
|
2 # Helper script to ease MEncoder two pass encoding
|
|
3 # Copyleft 2001 by Felix Buenemann <atmosfear@users.sourceforge.net>
|
9159
|
4 # This file comes under GPL, see http://www.gnu.org/copyleft/gpl.html for more
|
3024
|
5 # information on it's licensing.
|
|
6 use strict;
|
|
7 my $mencoder="mencoder"; # Path to MEncoder (including binary name)
|
|
8
|
|
9 die <<"EOF" unless @ARGV;
|
|
10 Menc2Pass: No arguments given!
|
|
11 Please give all usual encoding parameters you would give to mencoder, but leave
|
9251
|
12 away the pass=<n> suboption.
|
3024
|
13 EOF
|
|
14
|
|
15 for(my $i=1; $i<=2; $i++) {
|
9251
|
16 my $parm="";
|
|
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:";
|
|
22 } else {
|
|
23 $parm.="$val ";
|
|
24 }
|
|
25 }
|
|
26 print "Running $mencoder $parm\n";
|
|
27 system($mencoder,$parm)
|
|
28 and die "MEncoder pass $i failed!\n"
|
3024
|
29 }
|
|
30
|