First I looked at Zoneminder, setting up the camera (an axis 211) as normal and using a fps of 0.02 but I had problems getting it working well, and I wanted the whole of the external stage (4-6 weeks) in one movie.
So I came up with this method;
Create a directory on your server somewhere.
mkdir /timelapse
Setup a crontab entry to run a simple perl script every X minutes (I'm using five mins which condenses a day into about 3-5 seconds)
crontab -e
*/5 * * * * /timelapse/get_timelapse.pl
Create that perl script;
jed /timelapse/get_timelapse.pl
Code: Select all
#!/usr/bin/perl
# Fetches a remote image and numbers it sequentially to be stitched together later by ffmpeg or similar ot make a movie.
open(IN,"</timelapse/counter.txt");
my $cnt = <IN>;
$cnt++;
close (IN);
open(OUT,">/timelapse/counter.txt");
print OUT $cnt;
close (OUT);
system("wget -q -O /timelapse/$cnt.jpg http://10.0.0.119/axis-cgi/jpg/image.cgi?resolution=640x480");
Change the permissions on the script so it'll run;
chmod +x /timelapse/get_timelapse.pl
Go and have a cup of tea. When you come back, you should have 1.jpg and maybe 2.jpg or more.
(I also linked this directory from my http web root so I can check it remotely by web browser.)
When you think you've got enough pictures to try making a movie, copy them to a working directory (Don't work on them in the main directory in case something goes wrong and you lose the lot)
mkdir /tmp/film
cd /tmp/film
cp /timelapse/*.jpg .
Install ffmpeg if you haven't already
(In Debian:)
apt-get install ffmpeg
And simply run;
ffmpeg -i %d.jpg output.mpeg
The %d in the -i input clause tells ffmpeg to read the jpgs in order and create output.mpeg, your amazing timelapse movie!
You can play around with ffmpeg's settings to slow down or speed up the process, and if you want to remove chunks of data (such as long periods of night) - just delete the relevant jpgs before you create the movie.
Output for about a day and a half; http://www.youtube.com/watch?v=rP9PkpYlESI