It was recently announced that a new building is being constructed next to my office. It’s not any old building – it’s going to be a 26-storey tower, the tallest in Bristol! Working on the second-top floor of an adjacent office block, this is a great opportunity to get a birds’ eye view of the construction site.
This artist’s impression of the new tower, Castle Park View shows it looming over its surroundings. My office, One Castlepark, is circled in red – massively overshadowed! Clearly I am going to need a very wide angle lens to get it all in.
I’m on a very limited budget so I started off looking at wide angle webcams. This one was the cheapest one with a decent angle of view, but it quickly became obvious that at the close proximity, it couldn’t even fit the footprint of the construction site in – let alone the height of the tower.
So I decided to buy a USB camera with a fisheye lens. This one offered such a wide angle of view that it can see its own window frame – almost 180°! It easily encompasses the footprint of the construction site and hopefully will fit in most, if not all, of the height of the tower as it goes up.
I’m not fully happy with the image quality from the fisheye camera but it’s hard to judge when the weather is grey. It might benefit from a graduated ND filter to give extra exposure to the foreground.
The camera was supplied with a simple metal bracket so I knocked together a wooden stand for it, painted matt black to reduce reflections in the window. It has a heavy base and rubber feet to reduce vibrations, and a rubber washer at the “neck” joint so it can be set and will keep its position.
I did a lot of thinking about the number of pictures to take, etc and eventually decided over the duration of the construction (about 2 years), taking a picture every 10 minutes during daylight hours and playing back at 30fps would yield a video that plays for about 16 minutes. Here are the calculations from my spreadsheet…
|Frames taken every||10||minutes|
|That’s||6||frames per hour|
|Filming runs for||10||hours per day|
|There are||21||work days per month|
|Filming lasts for||504||days|
|Total frames taken||30240|
|Playback rate||30||frames per second|
|Video plays for||1008||seconds|
|Total data size||9.5||GB|
I decided to run the capture from an old Linux laptop I had lying around, although a Raspberry Pi would be ideal.
There are various time lapse capture tools around but I decided to keep it simple and use a tiny utility called fswebcam. This can be invoked with the following command line:
#!/bin/bash fswebcam -r 1920x1080 -D 3 -S 75 --no-banner --jpeg 85 /motion/$(date "+%FT%H.%M").jpg
Let me break this down a bit.
- fswebcam the name of the program
- -r 1920×1080 capture at full HD resolution
- -D 3 delay for 3 seconds to allow the camera to “warm up”
- -S 75 capture 75 frames before taking the real frame, to allow the autoexposure to stabilise
- –no-banner don’t overlay a timestamp etc on the captured image
- –jpeg 85 export the frame as JPG with 85% quality
- /motion/$(date “+%FT%H.%M”).jpg save the frame with a filename like 2019-03-13T18.00.jpg
Tweak this to suit your needs, save it as a script, and then invoke it as a cron job by adding this line to /etc/crontab
*/10 8-17 * * 1-5 root /motion/take-snapshot.sh
Cron formatting is a bit weird, so here’s what it means:
- */10 capture every 10 minutes
- 8-17 capture between the hours of 8am and 5pm
- 1-5 capture Monday-Friday
Note that due to the way cron interprets times, the first capture will be at 08:00 and the last will be at 17:50, not 17:00.
The frames will be stitched together into a video using the video editing Swiss army knife that is ffmpeg. There are many customisable options but here’s the gist of it:
ffmpeg -r 30 -pattern_type glob -i '/motion/*.jpg' -s hd1080 -vcodec libx264 timelapse.mp4
This hoovers up all of the JPGs that have been saved, mashes them together at a rate of 30fps and saves it as a full HD, 1080p, H.264-encoded video.
All I have to do now is wait for them to build the tower and hope the camera is pointing in the right direction! It’s a shame I’m so impatient…