Saturday, May 14, 2011

Time-lapse video of clouds over Boulder

We tend to get a lot of sunny days here along Colorado's Front Range, but right now we're enjoying some much-needed rain. After a couple rainy days earlier this week, the clouds broke Friday morning and we got one clear day before the clouds and rain returned today. Anticipating a nice scene when the clouds broke, I set my Kodak Zi8 on a tripod in my window and let it run. I cut out a 15-minute piece of video using Avidemux and then used modified code found here and here to prepare the video. First, I extracted two frames from each second of video:

ffmpeg -i 2011-05-13-original.mkv -r 2 -f image2 png/%05d.png

I then made a text file with the names of all the images and used mencoder to make a 30fps video:

ls -1tr > files.txt

mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=5000 -mf w=1280:h=720:fps=24:type=png mf://@files.txt -o time.avi

I then went to Jamendo to get some Creative Commons-licensed music to use the in the background. I chose "Shooting Star" by David Palmero, one of the first albums I found, and used Audacity to cut out a selection to match the length of the video. Lastly, I used PiTiVi to merge the video and audio together, with fade-in and fade-out transitions, and then rendered the video in a format YouTube would accept. The result:


  1. Very cool. I didn't know about PiTiVi, which will be useful for some random video projects that I end up doing.

    I also made a time-lapse recently of me working, but I used mplayer to take a shot every 15 seconds to get the pngs. I had to make the resultant video quite low-res to make it fit within some size limits though. It would have been nice to use PiTiVi to cut / speed up the night sections.

  2. PiTiVi is very basic and has no control for speed, but I do like it as a simple video editor. The only linux GUI I tried for speeding up the video was Kino, and it has the disadvantage of having to deal with everything as DV, which meant some ugly importing and some changing of aspect ratios and video quality that I could never quite control.