sourcecode
zentara
<code>
#!/usr/bin/perl
use warnings;
use strict;
# Usage: $0 'a_video_subdir_full_of_sequential_jpgs'
$|++;
my $videodir = shift || 'lamp_fix';
#put the video at the top of the long image list
my $video = $videodir.'/111'.$videodir.'.flv';
# recombine
recombine();
print "done\n";
exit;
###################################################
sub recombine{
opendir my $dh, $videodir or die "Error: $!\n";
my @files = grep !/^\.\.?$/, readdir $dh;
@files = grep /^(.*)\.jpg$/, @files;
closedir $dh;
#print "@files\n";
#audio options left in just incase you want to try adding audio
my @moptions =( 'mencoder',
"mf://$videodir/*.jpg",
'-mf', 'fps=29.97', #NTSC tv video rate in
# '-audiofile', "$base.wav",
'-srate', 22050,
'-o', $video,
'-ovc', 'lavc',
'-lavcopts', 'vcodec=mpeg4:vbitrate=100',
# '-oac', 'mp3lame',
# '-audio-delay', 0.2, #adjust for audio syncing problems
);
system(@moptions);
}
############3
</code>
Want to make a highly succesful how-to to put on You-Tube? Or maybe speed up looking thru your security camera still images? <p>Here you go....put a sequential list of jpg's in a subdir, and run this script on it. The output flv is conveniently named as 111****.flv so as to be at the top of your dir list. :-)<p>A sample of me fixing a lamp is <a href=http://zentara.net/~zentaran/111lamp_fix.flv> lamp_fix </a>
GUI Programming
zentara of perlmonks