Jigsaw Puzzle Time-lapse

This is what I did over winter break:

Details below, for the curious.

I used a Raspberry Pi with a camera module, stuck to the ceiling with double-sided tape, and about six different cables and extension cords, supported by a shoddy frame made of PVC pipes. I connected the Pi to my laptop via Ethernet, and mounted my laptop's hard drive on the Pi using sshfs. I recorded the video on the Pi with

raspivid -v -fps 10 -t 0 -o vid-part1.h264

and immediately played the growing file on my laptop:

tail -c +0 -f vid-part1.h264 |mplayer -cache 8192 -

This allowed me to see the video as it was being recorded, with only about a 0.5-second delay.

Assembling the jigsaw took 10.5 hours over three days. So the video above is playing about 140x faster than real time.

Then came the annoying part: Processing 54 GB of video. I know approximately nothing about video processing, so I don't recommend that anyone do this at home. I'm just recording my steps so that I remember how to do it next time.

First I dropped 9 in every 10 frames:

avconv -i vid-part1.h264 -filter:v "setpts=0.1*PTS" -vcodec libx264 out1.mkv

This took a few hours, and I was left with a number of short clips. I concatenated them and cut some dead time using openshot, then exported the result. Then I dropped some more frames to make the video the length I wanted:

avconv -i tmp.mkv -filter:v "setpts=0.5414*PTS" -vcodec libx264 out-video-only.mkv

Finally I loaded the soundtrack in audacity, adjusted the tempo a tiny bit so that the music and the video were the same length, and merged the two:

avconv -i out-video-only.mkv -i firestarter-stretched.mp3 -vcodec copy -acodec copy out-final.mkv

That was fun :)