Archive for July, 2010

How to make a timelapse shared memory server

July 14, 2010

The basic idea is this. You’ve got an old computer lying around. You’ve got a webcam or something else that can take pictures. So you can make yourself an information appliance. A simple one function shared device.

Can a timelapse server for a shared space serve a purpose like a logfile for a shared software development project?

Supplies:
1. Old pc/mac that is sitting a closet somewhere.
2. Capture card + external security cam OR usb webcam
3. optional web connection

Our current system is an old Dell Dimension running Fedora 11 Linux. Should work fine with most any linux distro.
Set up the machine:
1. install streamer(xawtv), ffmpeg, imagemagick, scrot(optional)
2. install scripts

The script for making timelapse movies is here:http://gist.github.com/475719
File includes many old comments but it’s a rather simple script.
Basic functionality:

initialize to a daily directory.
while [ 1 ]
do
if (new day)
then {make movie with ffmpeg, reinitialize to new daily directory}
fi
write timestamped jpg to daily directory
wait 20 seconds
done

The script for playing back the movies(videoloop.sh):

#! /bin/bash
while [ 1 ]
do
#mplayer -loop 0 -fs -shuffle /home/timelapse/Videos/copies/cam*.mp4
# vlc works too
mplayer -fs -shuffle /home/timelapse/Videos/copies/cam*.mp4
sleep 2 # this line is to make it easier to break out of.
# esc to leave playing. ctl-c to break out of script which will restart after 2 seconds.
done

don’t forget to make the scripts executable.

chmod 755 *.sh

If you’d like the movies to upload to a youtube channel automatically every night, you can do that as well. Instructions here.

A sample movie from the system:

Another earlier overview that shows some more detail about the actual connections:

another slight modified version that is at mit csail machine shop.

Advertisements