Time-lapse MPEG Animations 
by Stephen B. Jenkins

Example 1:

<meta http-equiv="Refresh" content="60">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">

     
Listing One

#!/usr/bin/perl
use warnings;
use strict;
use LWP::Simple;
$|++;

$SIG{INT} = \&catch_int;

my $interval = 60;
my $camURL = 'http://parliamenthill.gc.ca/text/newhillcam.jpg';

# capture the images
while(1) {
    my @t = localtime(time);
    my $imgname = sprintf("img%04d%02d%02d-%02d%02d-%02d.jpg",
                          $t[5]+1900,$t[4]+1,$t[3],$t[2],$t[1],$t[0]);
    print "Getting $imgname ... ";
    mirror($camURL, $imgname) || warn "Oops: $!";
    print "done!\n";
    sleep($interval);
}
# generate the animation
sub catch_int{
    print "\n\nDo you want me to create an mpeg? ";
    if( (<STDIN>) =~ m/y/i ){
        my @t = localtime(time);
        my $mpegname = sprintf("%04d%02d%02d-%02d%02d.mpg",
                               $t[5]+1900,$t[4]+1,$t[3],$t[2],$t[1]);
        print `convert -adjoin *.jpg $mpegname`;
    }
    exit(0);
} 





1


