annotate TOOLS/menc2pass @ 10252:d275152390ee

I've found some time to implement the encoding support for the new DivX API. Now it's possible to play and encode movies with the latest DivX release. One thing that doesn't work is the new Video Buffer Verifier (VBV) multipass encoding. The encoder segfaults. Maybe it just isn't supported with the standard profile of the released binary encoder. Andreas Hess <jaska@gmx.net>
author arpi
date Fri, 06 Jun 2003 19:57:37 +0000
parents 9733351ea3e5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3024
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
1 #!/usr/bin/perl -w
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
2 # Helper script to ease MEncoder two pass encoding
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
3 # Copyleft 2001 by Felix Buenemann <atmosfear@users.sourceforge.net>
9159
6b1bdda5ab76 0.0357l
atmos4
parents: 9158
diff changeset
4 # This file comes under GPL, see http://www.gnu.org/copyleft/gpl.html for more
3024
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
5 # information on it's licensing.
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
6 use strict;
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
7 my $mencoder="mencoder"; # Path to MEncoder (including binary name)
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
8
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
9 die <<"EOF" unless @ARGV;
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
10 Menc2Pass: No arguments given!
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
11 Please give all usual encoding parameters you would give to mencoder, but leave
9251
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
12 away the pass=<n> suboption.
3024
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
13 EOF
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
14
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
15 for(my $i=1; $i<=2; $i++) {
9251
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
16 my $parm="";
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
17 foreach my $val (@ARGV) {
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
18 if($val =~ /-lavcopts/) {
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
19 $parm.="$val vpass=$i:";
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
20 } elsif($val =~ /-(divx4)|(xvid)opts/) {
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
21 $parm.="$val pass=$i:";
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
22 } else {
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
23 $parm.="$val ";
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
24 }
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
25 }
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
26 print "Running $mencoder $parm\n";
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
27 system($mencoder,$parm)
9733351ea3e5 update to use lavc, xvid, divx4
atmos4
parents: 9159
diff changeset
28 and die "MEncoder pass $i failed!\n"
3024
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
29 }
7a5021d0a2de Small two pass mencoder helper script in perl.
atmos4
parents:
diff changeset
30