DISCLAIMER: All of this is a horrid hack. Don't blame me if it pees in your cornflakes.
Test timelapse from Mark Ng on Vimeo.
So, alot of you will have seen the Carsonified timelapse videos showing their team developing their new web application Matt.
When I saw this, the first thing I thought about was using this as a means of tracking my productivity. Looking back on a days work after you've done it can give you a lot of hints as to where you're wasting your time. So, I set about working out how to make these myself.
I butchered some bits and pieces of Applescript floating around the internet to take the pictures during the day. Note: I work with my laptop screen and a desktop monitor, and chose to record both of those (screen1 and screen2). The applescript is below :
set save_location to ¬
(choose folder with prompt "Choose where to save screenshots")
on quit
display dialog "Stop recording?"
buttons {"No", "Quit"}
if the button returned of the result is "Quit" then
continue quit
end if
end quit
repeat with shotcount from 1 to 1440
do shell script "screencapture -C -tjpg -x " & ¬
quoted form of POSIX path of save_location ¬
& "screen1-`date '+%y%m%d.%H%M'`.jpg "& quoted form of POSIX path of save_location &"screen2-`date '+%y%m%d.%H%M'`.jpg"
do shell script "/Applications/isightcapture "& quoted form of POSIX path of save_location &"face.`date '+%y%m%d.%H%M'`.jpg"
delay (60 * 1) -- delay 1 minute
end repeat
This expects a freeware program isightcapture to be in your /Applications/ directory, and you'll need to compile this script into an application and run it (it's also a bit flaky and doesn't quit properly - I don't know applescript at all and built this script in about 15 minutes.)
So, after running this for a whole day, you'll have a folder full of timestamped images. For the next part, you'll need imagemagick and mplayer/mencoder installed. I got both of these from macports, but you may choose to get them in some other manner.
To process the folder, first you need to merge the images together so that the screens and face appear in the same image. I did this with a shell script like this :
#!/bin/bash
mkdir processed
for time in `ls face*.jpg | awk -F"." '{ print $2 "." $3 }'`; do
montage -geometry '600x600' -shadow -background none -tile 2x face.$time.jpg screen1-$time.jpg screen2-$time.jpg processed/montage.$time.jpg
done
You may wish to mess around with the geometry and tiling, background, etc. You can take a look at this page about the montage tool in ImageMagick.
Finally, you need to use mencoder to make a movie ! Optionally, you can add an MP3 or ogg file for background music. Inside the processed image folder, run the following (Messing around with the fps can be helpful.) :
mencoder mf://*.jpg -mf w=1280:h=800:fps=4.3:type=jpg -ovc x264 -x264encopts pass=1:bitrate=256 -audiofile /path/to/music.mp3 -oac mp3lame -o timelapse.avi
You'll be left with an video file. I built one for the afternoon of that day. Interestingly, it was a day that I had to go out and pick my car up from servicing and also get my hair cut, which shows me some good productivity drains right there !
One comment so far