Making a time lapse video on Mac
This video is what you can create (that or something similar) by following these steps on your Mac.
Download & install a command line webcam capture utility, we will be using isightcapture
Open the DMG and extract the binary to
sudo cp /Volumes/isightcapture1_1/isightcapture /usr/bin/
Set up new directory to work in.
Lets use ~/captures/
Make script to take photo and save it
Insert the contents into the file:
CAPTURE="isightcapture -t jpg" cd $HOME/captures D1=`date +%y%m%d/%H` D2=`date +%y%m%d.%H%M%S` # If the date directory does not exist, create it if [ ! -d $D1 ] ; then mkdir -p $D1 fi # Construct the filename and path and capture a pic FN="$D1/$D2.jpg" $CAPTURE $FN # Make a symlinked image of the last photo taken if [ -h 'last.jpg' ] ; then rm last.jpg fi ln -s $FN last.jpg
Save and quit (:wq)
To be able to run this script we need to allow execution permission on this file.
chmod a+x captureme.sh
Put your capture script on cron
Write the contents:
* * * * * ~/captures/scripts/captureme.sh
Install a utility to convert a series of images to a movie. We will be using ffmpeg
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
We need to install ffmpeg to our machine, this process is going to basically compile the code. Hopefully nothing will go wrong for you here, if it does though, take a look on http://stephenjungels.com/jungels.net/articles/ffmpeg-howto.html
./configure --enable-shared --disable-mmx
sudo make install
Make script to grab photos and run them through ffmpeg
Write the contents to the file:
COUNTER=0; rm ~/captures/series/*.jpg for i in `find ~/captures -name '*.jpg'` ; do #Write the filename to be friendly with ffmpeg's odd filename input FILENAME=`printf '%03d.jpg' $COUNTER` cp $i ~/captures/series/$FILENAME let COUNTER=COUNTER+1; done nice ffmpeg -r 20 -vcodec copy -i ~/captures/series/%3d.jpg ~/captures/videos/timelapse_complete.mov
Again setting the permissions to be able to run the script and then run it to generate a movie based on the images taken so far.
chmod a+x make_complete_sequence.sh
View the finished result
Browse in finder to your home directory > captures/videos and watch the result.