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:
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.
Tags: history file, logfile, memory, physical space, shared, timelapse
July 25, 2010 at 8:04 pm |
[...] source can be a great help to small businesses. Here’s a way to use a Linux machine to make time-lapse movies from surveillance camera feeds. We especially enjoy the use of a desktop wallpaper that has the terminal commands necessary [...]
July 25, 2010 at 9:00 pm |
[...] source can be a great help to small businesses. Here’s a way to use a Linux machine to make time-lapse movies from surveillance camera feeds. We especially enjoy the use of a desktop wallpaper that has the terminal commands necessary [...]
July 26, 2010 at 2:59 am |
Uhm, is there a reason not to just use ZoneMinder for this?
July 26, 2010 at 3:21 pm |
we like writing script files!
zoneminder and motion look like good tools but we haven’t tried them. if anyone has a similar tutorial for one of those, please send along and we will add the link to the post.
July 28, 2010 at 6:47 pm |
The capture.sh you posted at github has several errors in it. Any chance you’ll post the corrected script?
July 29, 2010 at 12:11 am |
can you post the errors you are getting? pretty sure the github version is one we are using. Certain shells respond differently so depending on mac/linux and various distributions, there are sometime small changes required.
July 29, 2010 at 5:48 pm |
[...] LINK HERE [...]
July 30, 2010 at 1:22 pm |
I’d replace your backticks with “${foo}” to avoid splitting on whitespace. I see you have it in a couple of spots, but it isn’t consistent.
July 30, 2010 at 4:56 pm |
exact capture.sh file on machine:
#! /bin/sh
# boranj!
#
# ***************************************
# ******OMPD – One Minute Per Day – Voluntary Anthropology
# ******public timelapse wall
# need to install ffmpeg and imagemagick for this to work
# maybe wacaw too if you want webcam.
# mac tested but should be almost exactly same for linux.
# **************
# **************
# whatever you want to be your directory of files
cd ~/Pictures/OMPD
# make a subdirectory with today’s date, then go to it.
mkdir `date +%Y-%m-%d`
cd `date +%Y-%m-%d`
scrot lastscreen.jpg
streamer -c /dev/video0 -o camLAST.jpeg
DDDATE=`date +%Y%m%d`
DATETIME=`date +%Y%m%d%H%M%S`
counter=10000
# at 15 seconds per shot, 4/min, 240/hr, 10 hours = 2400 shots
# while [ $counter -ne 3400 ] # run a fixed number of shots.
#while [ `date +%H` -lt 23 ] # if it’s less that 11pm
while [ 1 ] # run all the time
do
DATETIME=`date +%Y%m%d%H%M%S`
NOWDATE=`date +%Y%m%d`
if [ $NOWDATE -gt $DDDATE ]
then
echo “day change”
counter=10000
# rename files sequentially for FFMPEG to work properly
for f in screen*.jpg; do
let “counter+=1″
mv $f screen${counter:1}.jpg
done
counter=10000
for f in cam*.jpg; do
let “counter+=1″
mv $f cam${counter:1}.jpg
done
# convert *.jpg ~/Movies/AUTOUPLOAD/OMPD-$DDDATE-$DATETIME.mp4
# this is a one liner you can run if you need to manually do a day that got missed.
# for f in *.jpg; do let “counter+=1″; mv $f screen${counter:1}.jpg ; done
#done
ffmpeg -r 20 -b 5000 -i screen%04d.jpg ~/Videos/screen$DDDATE.mp4
ffmpeg -r 15 -sameq -i cam%04d.jpg ~/Videos/camTL-$DDDATE.mp4
#ffmpeg -r 15 -b 5000 -i webcam%04d.jpg ~/Movies/AUTOUPLOAD/`
# -b 5000 to limit movie size.
cd ~/Pictures/OMPD
mkdir `date +%Y-%m-%d`
cd `date +%Y-%m-%d`
counter=10000
DDDATE=`date +%Y%m%d`
scrot lastscreen.jpg
streamer -c /dev/video0 -o camLAST.jpeg
fi
#let “counter+=1″
echo $DATETIME
#echo $counter # if you want to see the progression on the terminal window
# capture a JPG screenshot
HOURNOW=`date +%H`
if [ $HOURNOW -gt 25 ]
then
#screencapture -m -x -t jpg screen${counter:1}.jpg
#screencapture -m -x -t jpg screen$DATETIME.jpg
scrot newscreen.jpg
composite -blend 50 newscreen.jpg lastscreen.jpg middlescreen.jpg
cp middlescreen.jpg lastscreen.jpg
echo “captured screen”
convert middlescreen.jpg -resize 60% screen$DATETIME.jpg
# add additional imagemagick filters that intentionally art-ify the images?
echo “made screen smaller”
fi
HOURNOW=`date +%H`
if [ $HOURNOW -gt 8 ]
then
#scrot screen$DATETIME.jpg
streamer -c /dev/video0 -o cam$DATETIME.jpeg
#streamer -c /dev/video0 -o cam$DATETIME.jpeg
#wacaw –jpeg -n 4 webcam${counter:1}.jpg
echo “captured cameras”
#composite -blend 20 camNEW.jpeg camLAST.jpeg camMiddle.jpg
#mv camMiddle.jpg cam$DATETIME.jpg
#rm camLAST.jpg
convert cam$DATETIME.jpeg -resize 200% cam$DATETIME.jpg
#cp camMiddle.jpg camLAST.jpg
fi
rm *.jpeg
#wacaw –jpeg -n 4 webcam${counter:1}.jpg
# resize images using imagemagick here?
# convert webcam${counter:1}.jpg.jpeg -resize 95% webcam${counter:1}.jpg
# mv webcam$DATETIME.jpg.jpeg webcam$DATETIME.jpg
#convert screen${counter:1}.jpg -resize 50% screen${counter:1}.jpg
# capture an image from the webcam using wacaw package. get from sourceforge
#
# download zip file. unzip. run these two things at command line
# sudo cp wacaw /usr/local/bin; sudo chmod +x /usr/local/bin/wacaw
echo yofool
# number of seconds between shots
sleep 20
# make a beep here? display a shot onscreen?
done
# one shot/15sec, played at 10 fps = 150x speedup. 150min(2.5hr) = 1 min vid. 10hrs = 4min
# about mac cron jobs on laptops and sleep times
# http://www.thexlab.com/faqs/maintscri…
August 19, 2010 at 12:43 pm |
Hi, you can try SebecTec software to make a time-lapse.
February 18, 2011 at 7:31 pm |
[...] The Broadcaster Project so you can really say, "i know where you're coming from" « How to make a timelapse shared memory server [...]
August 11, 2011 at 7:22 pm |
[...] on a computer in the back corner of the music venue. Instructions to make your own are on his blog, and Paluska says he’d love if someone else took interest, tweaked the program in their own ways [...]
October 30, 2011 at 5:22 pm |
[...] you can learn to make if you want: A videobooth, a public timelapse server, command line video remixing, computer timelapse self surveillance, youtube upload scripts, a [...]