Water and Structures

The flow of water itself can make for some interesting photographs, especially when slowed down. However just the presence of water can cause some interesting structures to be built, often for navigation or just for avoiding getting ones feet wet when crossing said water.

This is bridge 29 on the Grand Union canal near Leamington Spa, UK. It’s fairly typical of the brick built bridges which cross this canal. They were constructed when the canal was dug either to carry existing roads or to let livestock get from one side to the other. To save on construction costs the canal is normally narrower at the bridges which can make life difficult if you meet a boat coming the other way.

Also on the Grand Union canal is the famous Hatton Flight of locks. There are 21 of them in total and, on a good day, it will take about 3-4 hours to get through them all. Some years ago we owned a canal narrowboat and made two trips through these locks. After the second one I was firmly told by my kids that, if we did it again, I’d need a different crew 🙂 We used to live within walking distance of the flight and it got pretty crowded on a sunny summer weekend, both on the banks and on the water.

This is a jetty on a lake in Austria. In the summer the lake is busy with trip boats but it’s deserted in the winter.

These are two pictures of a disused railway bridge just south of Stratford-upon-Avon, UK. This line was part of the Great Western Railway’s route from Cheltenham to Stratford-upon ( also known as the Honeybourne Line ). It closed to all rail traffic in 1976 and is now the route of the Stratford Greenway foot / cycle path. These photos are of the old bridge across the River Avon just south of Stratford, the cycle path runs across a newer bridge of much simpler construction just next to it.

I’m not sure why this bridge needed such a complex latticework construction. However the river navigation lock in Stratford has a similar overhead construction ( albeit much simpler ) which is necessary because the ground is unstable. Maybe it’s the same here.



Posted in Photography | 2 Comments

Timelapse and Webcams – 2

In a previous post I described some experiments with downloading webcam images from the internet and putting them together for a timelapse movie. However that method would only work for cases where individual images are uploaded to the same URL and not all webcams use that method. Some of the more interesting views use more sophisticated hardware/software systems which provide embedded viewers and servers to show the images. These packages often include some basic timelapse creation but usually of fixed resolution and time periods.

One such system is Deckchair and there are a quite a few installations around the world. Although it’s more difficult to capture these images they are at HD resolution and the cameras that are used seem to be of a higher and more consistent quality. The Deckchair website has a browser showing the cameras in operation around the world and I thought that it might be interesting to try and capture the images from central London over New Year’s Eve 2017. Because of the relatively low refresh rate of these cameras ( 5 minutes ) then it’s unlikely that much of the firework display will be captured but the general setup and crowds could be interesting.

Copied from my previous post but still important: The question of copyright of streaming webcam images is a complex one. According to Wikipedia and to a document written by a Swiss legal firm the question is largely untested in law and it’s likely that a webcam would fail the originality / individual character part of the copyright protection requirements. However IANAL so please take your own precautions especially if you intend using these images commercially. In any event I would strongly suggest that you contact the owner of the webcam to see if they’re happy with what you’re doing.

After a quick review the Park Plaza Hotel near Westminster Bridge seemed promising and here’s a timelapse showing the 24 hour period around New Year’s Eve. Details of how these images were captured are provided below.

There are lots of interesting details in this movie but I love the way that the boats all gather just before midnight to watch the fireworks 🙂 I did contact the parent company of the Park Plaza Hotel to get agreement to use their webcam images but got no response.

Technical Notes

A lot of the donkey work has been wrapped up in some Lua scripts. Unfortunately basic Lua is not sufficient and two extra modules are needed:

  • SSL interface to download the data from the Deckchair website. I used https://github.com/brunoos/luasec/wiki. This needs to be built and will need the “libssl-dev” package installed
  • Some downloaded data is JSON encoded and needs to be decoded. I used http://regex.info/blog/lua/json and this is written in pure Lua so just needs to be dropped into the directory containing the other scripts.

The scripts below have minimal error checking but any missing images are likely to render the final movie pretty useless anyway.



Deckchair has a GitHub repository and an API which is documented in some detail. This is very useful and reduces the amount of poking around in HTML sources that has to be done.

Finding Cameras

Suitable cameras can be found in one of three ways:

1. An internet search which can be a bit hit or miss.

2. The Deckchair API has a command called “GET.Cameras” which should return some details of all installed cameras. A simple Lua script to access this data is:

#! /usr/local/bin/lua

local http=require'socket.http'
JSON = assert(loadfile "JSON.lua")()

local body,c,l,h = http.request( "http://api.deckchair.com/v1/cameras/" )
local cameras = JSON:decode( body )

for i in pairs( cameras.data ) do
 print( cameras.data[i].title .. " ( " .. cameras.data[i].adCaption .. 
                  "/ " .. cameras.data[i]._id .. " )" )

However this doesn’t provide the whole list, see point 3 below. I’m not sure why this is the case, I suspect that either the data hasn’t been updated or some customers don’t want their details published.

3. The Deckchair website has a camera browser which shows the latest image from each installed site and this is probably the easiest way of identifying cameras.

One point to note is that any further processing will require the camera ID. From the API this is returned directly and is a GUID which looks something like: “589ae123f399393952be6b2d”. The camera ID can be retrieved from the user’s site HTML code, somewhere in the page there will be a reference similar to “https://camera.deckchair.com/589ae123f399393952be6b2d” and the number at the end of the URL is the camera ID.

Getting a List of Images

One of the advantages of these systems is that the images may be cached on the server and there’s no need to leave the computer running to “record” the images in real time. This also makes it possible to create retrospective timelapses.

The relevant API is called “GET.Camera/Images” and this needs 3 parameters:

  • Camera ID – the value obtained in the previous section
  • From – time of the first image
  • To – time of the last image

Note that the time stamps need to be in Unix time format. I use this handy converter. For the movie above the two timestamps were Dec 31st 12.00 ( Unix time = 1514721600 ) to Jan 1st 12:00 ( Unix time = 1514808000 )

The result of the API call is list of image IDs ( also GUIDs ). Note that the images are returned with the latest at the top of the list so some slight juggling is needed in the Lua script:

#! /usr/local/bin/lua

local http=require'socket.http'
JSON = assert(loadfile "JSON.lua")()
assert( #arg == 3 )

local body,c,l,h = http.request( "http://api.deckchair.com/v1/camera/" .. 
                       arg[1] ..
                       "/images?from=" .. arg[2] ..
                       "&to=" .. arg[3] )
local images = JSON:decode( body )

-- Reverse the order
for i=#images.data,1,-1 do
 print( images.data[i]._id )

The script takes three parameters – camera ID, start time and end time and prints a list of image IDs. These IDs should be redirected to a file for further processing.

Downloading Images

Once the image list is available then it’s a case of repeatedly calling the “GET.Image” API call and writing the images to disk. The following Lua script takes a list of images captured by the previous script, downloads them and numbers them sequentially:

#! /usr/local/bin/lua

local http=require'socket.http'
JSON = assert(loadfile "JSON.lua")()

-- Check for file name as argument
local inputFile = assert( io.open( arg[1], "r") )
local imageCount = 0

for imageID in inputFile:lines() do
  print( "Fetching: " .. imageID )
  local body,c,l,h = http.request( "http://api.deckchair.com/v1/viewer/image/" .. 
                                       imageID )
  local outputFile = assert( io.open( "images/" .. 
                          string.format( "%04d", imageCount ) .. 
                          ".jpg", "w" ) )
  outputFile:write( body )
  imageCount = imageCount+1;

Image Processing

Once the images are downloaded then it’s simply a question of following the normal workflow that I described in my original post. For the movie above I downsized the 1080p HD images to 720p to reduce the movie size a little using the following Imagemagick command:

for i in *.jpg; do convert $i -resize "1280x720!" resize/$i; done




Posted in Timelapse | Leave a comment