Simple Time-Lapse
Time-lapse animations have always fascinated me. With a time-lapse you can make things visible to the human eye that are normally happening too slow. The movement of stars in the sky or the process of putting up a house are very interesting to look at when the clock has been accelerated.
Apart form creating time-lapse animations using my own pictures I also found it worthwhile to create them from web-cam images. A webcam near the place I live provides images of quite high resolution. With the little script below, I was able to create this video: Fog over Dornbirn
I found that for videos that include clouds it is ok to take a frame every 5 seconds or so. As I don’t have the time and patience to save the webcam images manually, I created this bash script which was improved by Jürgen Hofer subsequently:
# !/bin/bash
# copyright Philipp Salzgeber - www.salzgeber.at
# adapted by j! for cleaner results
# first cmd line parameter is the delay in seconds (optional, default is 60)
# script stops if there is the file 'killme' in directory (for remote stop via dropbox)
divider=${1-60}
url=http://karren.protask.at/record/current.jpg
let "pause= $divider * 90 / 100"
while [ ! -f ./killme ]; do
#wait for zero crossing
secs=$(date -u +%s)
let "mod= $secs % $divider"
while [ $mod -ne 0 ]; do
secs=$(date -u +%s)
let "mod= $secs % $divider"
done;
# create a filename with date and time portion
filename=$(date -u +"%Y%m%d_%H_%M_%S").jpg
# use wget to download the current image from the webcam
wget -nv $url -O $filename
# wait
sleep $pause;
done;
echo exit condition found
Read More →