May 4, 2016 - Uploaded the Stillwater Time-Lapse Video 2016-1

Post date: May 05, 2016 12:35:33 AM

I uploaded the "Stillwater Time Lapse 2016-01" video to YouTube, for images collected from January 1st to April 30th 2016. You can click on the image below to view the video. I did run into a problem this time, and some of the days are incomplete. In my scripts, I use the Yahoo Weather API to grab the daily sunrise and sunset times, so I know when to start and stop collecting the images from the webcam. Unfortunately, on March 25, Yahoo changed their API without warning. As a result, my script started behaving differently. It only gathered images for half the day, from sunrise until about 12:15 pm. This continued until April 20, when I realized what had happened and had time to fix the script. Also, for a while I just thought the webcam was broken, so that lengthened the problem.

A couple friends have asked me how I went about creating the video, so here goes. The images are updated from the webcam every five minutes, from just before sunrise to just after sunset. If you dig into the source code of the webcam page, there is a direct URL to the JPG image that gets overwritten every 5 minutes by their software and services. I grab that JPG image every time it updates, for the entire day. At the end of the day, the gathered images are rolled into a video that runs at 6 frames per second, so the video ends up being around 30 seconds in length per day. The daily video is also appended to the end of a roll-up video for the current time period. By the end of a 4 month period, the video is about 45 minutes long. I then take that 4 month long video, and speed up its frame rate by a factor of 10, to 60 frames per second, and then scale its resolution up to a 720p, high definition video. That cuts the video down to under 5 minutes in length, while still containing every picture taken in the 4 month period. This format can be uploaded to YouTube natively. While watching the video on YouTube, if you go down to the bottom right corner and click on the gear symbol for settings, you can change the resolution to 720p60HD. You can then slow down the play speed to 0.25. With this setting, every image from the 4 month period is shown.

In order to do this, I wrote two BASH scripts on a Linux server I have running 24/7 at home. The first script downloads XML weather data from Yahoo Weather, parses it for the desired data, and outputs files containing the sunrise and sunset times for the day. The other BASH script then uses those two files to determine when to start and stop for the day, and uses the Linux command WGET to download the JPG file from the webcam website every 5 minutes. The script saves every image with a time tag appended at the end of the file name, so it can differentiate the files. At the end of the day, the script wraps up by using MENCODER to combine the JPG files into a video for the day. The script then uses MENCODER to append that video to the roll-up video. Once done, TAR is used to archive all the files for the day into one file and compress them to save space. The archives end up being around 160-200 MB per month, depending on season, the amount of sunny days, the average length of days, and other factors affecting the number of source images, and the source images' individual sizes.