Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > 4d9f46962723fd45a40208c556763ee8 > files > 52

perl-SWF-0.4.5-14.1.mga6.x86_64.rpm

#!/usr/bin/perl
use strict;

#use lib("/home/peter/ming3/lib/perl5/site_perl");

$|=1;
use SWF qw(:ALL);

my $file = '../common/test.flv';



my $stream=new SWF::VideoStream($file);
$stream->setDimension(200,200);

my $m=new SWF::Movie();
$m->setDimension(400, 300);
$m->setRate(12.0);
$m->add($stream);
for(1..$stream->getNumFrames()) {
	$m->nextFrame();
}

# decide if its called from commandline or as cgiscript
if (exists $ENV{"REQUEST_URI"}){
	print "Content-type: application/x-shockwave-flash\n\n";
	$m->output();
}
else {
	$m->save("$0.swf");
	print "Generated file written to $0.swf\n";
}