Nick Winter originally did this with Telepath Logger. Bethany managed to get that working for her maniac week and helped Danny get it working on his computer but it involved hacking on the actual code and we wanted to experiment with a setup that anyone could use. Also, we wanted to do things like tail our TagTime log files in the dashboard area (aka HUD). So, with ideas from Lawrence Evalyn, here’s how we did it:
Set up InstantShot (Mac OSX) to take a screenshot every minute and store them to a specified directory.
Instead of trying to capture a separate video from your webcam and splice it together, just leave a small window with a live-updating image from your webcam at the bottom of the sreen and let the screenshots capture it. Here are possible things to use for that:
CreateDialog[Dynamic[ImageResize[ImageReflect[ImageCrop[CurrentImage[], {320/2, 240/2}, {Center,Top}], Left], 320], None, UpdateInterval->Infinity, SynchronousUpdating->False], WindowTitle->"I'm a maniac"]
Lawrence Evalyn says he got the images turned into a video using iMovie. For later timelapses, iMovie has been less able to deal with the huge number of images in a timely manner, so he just searched “time lapse” in the Mac app store and picked a free one, Zeitraffer, which also worked. That might or might not be easier than Bethany’s uebernerd hackery with ffmpeg below…
In your images directory, crop all the images and write them to numbered imgXXXXX.jpg files in a subdirectory called tmp:
x=1; for i in *.jpg; do counter=$(printf %05d $x); convert -crop 5120x3200+0+0 $i tmp/img"$counter".jpg; x=$(($x+1)); done
Or if you just need to name them to have consecutive numbers in the filename:
mkdir tmp
x=1; for i in *.jpg; do counter=$(printf %05d $x); cp $i tmp/img"$counter".jpg; x=$(($x+1)); done
Make a movie out of the images in tmp/ with 30 frames per second. Write it to maniac.mp4:
ffmpeg -r 30 -f image2 -i tmp/img%05d.jpg -y -s 2560x1600 -r 30 -vcodec libx264 -preset slower -tune stillimage -crf 18 maniac.mp4
Find a soundtrack as an m4a file and add it to the video:
./ffmpeg -i maniac.mp4 -i somesong.m4a -c:v copy -c:a copy -map 0:0 -map 1:0 -map 1:0 maniac_with_soundtrack.mp4
If the sound file is longer then add “-shortest” before maniac_with_soundtrack.mp4 to have the soundtrack cut out when the timelapse ends.
(Bethany had issues with this that turned out to have to do with the encoding of the music. When she edited together a soundtrack in audacity and exported with an ffmpeg compatible filetype it worked fine.)
Bethany also made this for showing the time and day:
The idea is to put it in browser window shrunk down so it fits in your dashboard area. It’s worth having something dynamic like this in your dashboard otherwise there’s nothing interesting to see in the timelapse when you’re asleep. If you don’t want to count on an internet connection just grab the page source and put it an html file and open it that way. Safari seems to work