annotate TOOLS/menc2pass @ 10578:b9d289fd8a57

10000l, the old code was slow as hell, copying stuff extra times and actually broken -- blanking the whole screen at each 'page flip' with -dr enabled. benchmarks: before: 56% cpu for decode 56% cpu for vo with no -dr 25% cpu for vo with -dr after: 56% cpu for decode 25% cpu for vo without -dr 0% cpu for vo with -dr if vo_fbdev is going to do pageflip, it needs to do it for REAL, using vertical scroll registers (like g2), not copying a temp buffer (which will shear anyway and is super-slow).
author rfelker
date Tue, 12 Aug 2003 08:24:24 +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