Time Lapse Photography with a QuickCam

May 5, 2001

Something I've wanted to do for quite some time is a time lapse movie of a static view, spanning an entire year. It could be presented in a number of ways, for example a fast 12-second (30fps) view of one exposure at noon every day, or a longer sequence covering all the daylight hours, equalized for brightness, or an even longer one covering all hours. Also I would want to make a 2-dimensional graphic, 365x240 pixels, one for every 10 minutes of the year, with the pixel colour being the average colour of a small patch of sky.

Over the course of a year, the sun covers quite a bit of the sky, and aiming a video camera at the sun for any extended time period will harm it. So the only available static view is looking pretty much straight north. I can get something of a reasonable north view from the house here, but I don't have command of a window where a camera could operate undisturbed for a year.

I'm thinking about my parents' camp. There is a decent north facing view right from the cottage. Perhaps I could put a computer in the attic and have the camera peer out from a knot hole in the wood siding? Still, the difficulties are great. There are power failures out there, and there is no internet connectivity, and I get there maybe two to three times a year and one of those is in the winter when the cottage is shuttered and cold. The camera setup would have to operate from -35°C to +35°C, and recover automatically from power failures, and have enough disk space to buffer up the whole year's footage, and... hmmm.

Anyway there's also the question of a suitable camera. My old digicam? For video purposes it makes fantastically good pictures -- reasonably sharp 640x480 is DVD quality after all. But taking over a hundred thousand exposures with it in a harsh climate? Perhaps it's still too valuable for that. Also if it ever loses power, it won't turn back on when it regains power and there's no way to fix that, so I'd have to have battery backup and ... oh boy.

Now, a while ago I got an old parallel port Logitech Colour QuickCam at a computer flea market for $10. There's a very versatile command-line Linux driver for it. This begs experimentation.

So, today an old 486 box upstairs has been running this script:

   #!/bin/csh -f
   while 1
      sleep 120 &
      ./cqcam  -r -j -l 8 -q 75 -R 145 -G 128 -E 120 >pic.jpg
      set b = `awk '{print $2}' ~/.cqcrc`
      set d = `date +"%s"`
      mv pic.jpg img_${d}_$b.jpg
      wait
   end
It makes a sequence of images with names like these:
   img_989075607_50.jpg
   img_989075727_50.jpg
   img_989075849_49.jpg
   img_989075968_49.jpg
   img_989076087_49.jpg
The numbers are the Unix time stamp (seconds since 1970) and the automatically determined brightness compensation (whereas I've fixed the colour balance to about noon daylight).

Another setback - the QuickCam cannot handle full sunlight. The pictures are all washed out and horrible. I have to outfit it with sunglasses. An old 85C camera filter (i.e. amber, to use tungsten-balanced film outdoors) was handy. This was sufficient.

What you see below is the first picture it took, at about 11AM today. It's been taking pictures at 2 minute intervals ever since. If you click on the picture, you will get an MPEG-1 movie covering 11AM to nightfall at 1 hour / second (with the first and last image held for a second each). The video is 855 kilobytes.

Longer movie, covering a whole day (1.94MB)

Anyway, for this particular scene, each saved JPEG frame is about 18 kilobytes (I want to save the individidual frames for post processing flexibility). I figure for the "year cam" I'd take one picture every 5 minutes, for about 2 gigabytes / year. I've got a spare hard disk that can hold it. Whether a hard disk (and the power supply fan) can operate at -35°C is another question. Oh well, I can always keep thinking about it.

June 18, 2002

I didn't do anything about the year cam idea. I probably won't ever get around to it. So go ahead, take my idea and beat me to it. If you do, send me a link to the result.

I found an old 486 laptop at a garage sale that's perfect for running the time lapse camera, so I installed the necessary software on it. I was at a friend's place for dinner, and had the system along intending to set up a video of a bird's nest on her balcony. This was not practical. As we sat around, grey clouds started filling the blue sky outside. Too late I realized that this would make a good time lapse shot. I set up anyway, and still got some interesting movement. In this video you can see jerky movement sometimes, because the cqcam utility captures images repeatedly until it gets the exposure right, so that that the exact time the final exposure is taken varies, and with the short interval between pictures (20 seconds) the timing jitter shows. The video is 2.04MB in size. The quality is somewhat better because I did some additional tweaking of the parameters for the Berkeley MPEG-1 encoder.

Re-encoded to DivX format (Only 791KB, almost as good quality)

Markus's Home Page