Wednesday 18 April 2007

Timelapse movies with webcams

Recently I have been interested in using some of those webcams lying around to produce some interesting experience of time.

I started off with the one at home and attached it to our asus wl-500g premium router running linux (through the help of www.openwrt.org). The camera is a Creative Nx Pro, and I don't know if it is the driver or what, but it doesn't stand daylight very well. The images get very white during day. I have succeeded in making timelapse movies out of the resulting still images, but until I find a new camera / change the driver settings it can't be used for outdoor filming.

I will be looking into how I possibly could use a digital camera instead. This would give me much better image quality. More about that later.

Anyway - in the mean time I thought I would have some fun with other peoples webcam pictures. On my account on www.dreamhost.com I have set up different conjobs like this:

crontab -l
0 3 * * * wget http://some_webcam_host/fullsize.jpg -O ~/folder_to_store/$(ls ~/folder_to_store/ | grep ".jpg" -c).jpg > /dev/null 2>&1


This saves one image at noon (in Norway - the server is in the US) from each webcam into separate folders with sequential naming of the files (0.jpg, 1.jpg, 2.jpg etc).
This makes it easy to process the images into movies with ffmpeg like it is done at the motion - wiki:

find . -name '*.jpg' -exec cat '{}' ';' | ffmpeg -f mjpeg -s 640x480 -i - -y -r 25 -aspect 4:3 -vcodec mpeg2video -sameq lapse.mpg

I will post some results here when there are some interesting movies made.

No comments: