/[amv]/frames.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /frames.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by dpavlin, Thu Jul 19 20:17:06 2007 UTC revision 10 by dpavlin, Fri Jul 20 16:02:14 2007 UTC
# Line 11  use File::Path; Line 11  use File::Path;
11    
12  my $tmp = '/tmp/frames';  my $tmp = '/tmp/frames';
13  my $out = '/tmp/frames.avi';  my $out = '/tmp/frames.avi';
14  my $jpeg_q = 10;  my $jpeg_q = 100;
15    my $repeat = 16;
16    $repeat = 1; # off
17    
18    rmtree $tmp if -e $tmp;
19  mkpath $tmp || die "can't create $tmp: $!";  mkpath $tmp || die "can't create $tmp: $!";
20    
21  my $im = new GD::Image( 160, 120 );  my $im = new GD::Image( 160, 120 );
# Line 45  my @cols = ( Line 48  my @cols = (
48  my $frame = 1;  my $frame = 1;
49    
50  foreach my $c ( @cols ) {  foreach my $c ( @cols ) {
51          foreach ( 1 .. 16 ) {          foreach ( 1 .. $repeat ) {
52                  $im->fill(50,50, col($c) );                  $im->fill(50,50, col($c) );
53                  warn "frame $frame\n";                  warn "frame $frame\n";
54                  my $path = sprintf('%s/%03d.jpg', $tmp, $frame++);                  my $path = sprintf('%s/%03d.jpg', $tmp, $frame++);
# Line 59  system("ffmpeg -i $tmp/%03d.jpg -r 16 -v Line 62  system("ffmpeg -i $tmp/%03d.jpg -r 16 -v
62          die "encoding failed: $?";          die "encoding failed: $?";
63    
64  rmdir $tmp || die "can't remove $tmp: $!";  rmdir $tmp || die "can't remove $tmp: $!";
65    
66    warn "created $out ", -s $out, " bytes\n";

Legend:
Removed from v.2  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26