In an earlier post, I had mentioned an apple seed that I had stuck in the of dirt of a flower pot in the kitchen; the seed sprouted and I had the photo-snapping-rig setup to capture the little guy grow.
Well, the seedling did not make it – it died. But, I managed to capture all but the very first day of the seedling. The video takes about nine days of photos and compresses it down into about 30 seconds.
I will apologize a head of time for this posting. It takes a bit of a dive into nerdom with some technical specifications, talk of Linux, servers, a mentioning of a thing called firewire and, at the end, there is information on the software that I am using to make time lapse videos. But, interspersed between bits of this and that are some time lapse videos as well as some other nice photos.
Around five years ago, I made a time lapse video from a series of photographs. The photographs, all 4,748 of them, were taken using a JVC MiniDV camcorder. The camera was tethered to a PowerBook (running Linux) via a firewire cable; the laptop would trigger the camera and then download the still-frame every 15 minutes. Each photo was then uploaded to a server that was running in the basement. The original video that was produced was over ten minutes long – the above video is a reprocessed version sped-up by four times.
Using a bit of software that I wrote, each photo was analyzed to determine if it was “too dark”. The analysis consisted of averaging the value of all the colors contained in a given photo; if the average was too close to black, the photo was rejected. Another bit of processing involved inserting text, a timestamp and a watermark into the photo being processed. Given the tools I was working with – a crufty PowerBook (held together with duct tape) running Linux and a MiniDV camera – embedding the text, timestamp and watermark as part of the photo/image made sense to me at the time. Looking back, it would have been more useful to not have embedded that information into the images; some other location – either an ancillary place or even within each JPEG.
This go around, I am still using a nine year old camera (in 2009, the camera I used was from 2000), but a nine year old in 2014 is a different bit of technology than a nine year old camera in 2009. The newcamera is a Nikon D50 with a 35-70mm lens. The camera body, lens, DC power adapter, and USB cable came to a total of about $225. The laptop that is effectively acting as an intervalometer would likely sell for another $225 (or less), but since the laptop is one that I have had for a long while and no longer actively use it, it is plausible to think of it as having no cost for me.
If you are still unclear as to what I am talking about with intervalometers, laptops and Nikon cameras, the basic idea is making a camera take a picture again and again and again at a regular interval. It is kind of like regular motion pictures but on a much slower pace. Instead of having 24 or 30 frames per second (as with a typical motion picture), there is only one frame every fifteen minutes. Fifteen minutes is about the closest interval between photos that does not cause a tremendous waste of disk space and, in my case, you are able to capture enough difference in plant growth that it is noticeable; at 5 megabytes per photo, it amounts to a little less than half a gigabyte per day – with the particular laptop, I could safely shoot 140 days of photos. Add a tweak to the software mix – and push the photos else where – like Amazon S3 – and you have an unlimited number of days.
Once I have a pile of photos, they need to be strung together into a video. In the Apple ecosystem, there is iMovie. It is relatively inexpensive and is fairly easy to use. This is what I use. If you are hellbent on free or open source – checkout ffmpeg.
But that does not actually clear-up getting photos from the Nikon to the laptop; it also does not clear-up getting the laptop to trigger the camera at regular intervals.
I am using gphoto2. This is a bit of open source software. It took a bit of wrangling to get it to work, but it is quite robust and, so far, is quite reliable. At the end of this posting, there are some random notes and a link to a bit of software I wrote to make it easier to trigger, download from the camera, and rename the photos in a consistent manner.
I am not sure why I like making or even watching time lapse videos of plants growing. Maybe it has to do with being able to visualize something that ordinarily takes too long to be noticed by the human eye.
Currently, the photo-snapping-rig is busy taking photos of a seedling started from a seed I pulled from a Braeburn apple. The seedling is about an inch tall; its cotyledons have spread and the second set of leaves are little tiny spikes just above the stem. I plan to photograph it for a couple weeks, or until the tripod the camera is attached to gets bumped.
Notes for a deep dive into nerdom:
If you are using Windows, you are on your own – I have not been an active or engaged Windows user for years. You’ll likely need cygwin in order to get gphoto2 working. If you are using a Mac, I found it easiest to use homebrew. Install homebrew, and then a simple brew install gphoto2 did the trick to get it installed. I also installed ufraw for processing Nikon Raw format photos, but this is not necessary if you are using other Apple pieces of software for knitting your photos into movies (e.g. iMovie).
The camera needs to be in “PTP Mode” to communicate over USB; this is done by actually changing a setting on the camera – most likely by changing a setting from USB Mass Storage to PTP Mode. Once you have done that, with the camera connected to the computer, issue the command:
#> gphoto2 --auto-detect
Nikon D50 (PTP mode) usb:253,003
If you are on a Mac, you will likely get an error at this point – instead of getting the listing of the attached camera. Apple has a “helper process” that may latch onto the USB of the attached camera. This will prevent gphoto2 from being able to communicate with it.
My solution was a bit of a big hammer. I moved the offending program out of the way so it could be executed to latch onto the USB. Another approach would be to terminate the process. The program is called “PTPCamera”; if you would like to use the small-hammer approach, terminating it from a command line can be done like this: