DIY time-lapse photography
Time Travel
Using a few simple components and open source software, you can create impressive panoramic time-lapse photos. We guide you through the entire process, from building a simple panning rig to assembling photos into a time-lapse video.
Although time-lapse photography [1] is nothing new, it remains a popular genre with enthusiasts and amateur photographers alike. And it's easy to understand why: Time-lapse movies assembled from multiple photos can be beautiful and mesmerizing, offering a radically different view of the world around us.
Time-lapse photography is great as it is, but adding panning to the equation takes the concept to another level. The idea behind panoramic time-lapse photography is rather simple: Instead of remaining in a fixed position, the camera slowly pans in one direction (e.g., clockwise) while taking photos, which makes it possible to capture panoramic time-lapses of landscapes, city skylines, cityscapes, and so forth.
You may think that creating panoramic time-lapses requires expensive hardware and software. In fact, this type of photography is ideal for tinkering with hardware and putting open source software to creative use, so if you happen to have a Canon PowerShot compact camera or an Android smartphone, building a simple panning rig and creating time-lapse videos makes a perfect weekend project.
Building a Low-Tech Panning Rig
The first order of business is to build a panning rig. Although you can build a panning solution with Raspberry Pi or Arduino, you have a much simpler, cheaper, and decidedly low-tech alternative. The key component of this panning device is an Ordning egg timer [2] which can be procured at any IKEA store. When you wind up the timer, the top part slowly moves clockwise, which makes it an ideal panning platform.
Better still, the top plate of the timer is perfectly flat, so you can easily mount the camera on it (Figure 1). One way to do this is to attach a screw that fits the camera's tripod bush to the top plate. A common M6x16 flat-head (hexagon) screw, which can be found in many home improvement stores, will do the job. To attach it to the timer's top plate, use either strong glue or Sugru [3].
Keep in mind, however, that the timer itself can support only a very light load and the entire solution is not very stable. This means that you can only mount a relatively lightweight camera like Canon PowerShot S90, and you should secure the entire setup during the capturing process.
Preparing the Camera
The main reason you need a Canon PowerShot series compact camera for this project is because this camera's capabilities can be extended using the CHDK open source firmware [4]. Among other things, CHDK lets you automate camera actions, like taking multiple photos at predefined intervals using uBasic and Lua scripts.
The simplest way to install CHDK on an SD card is to use the STICK tool [5], which can detect your camera's firmware version, fetch the appropriate CHDK build, prepare the SD card, and install CHDK on it. STICK is written in Java, so you need a Java Runtime Environment (JRE) installed on your machine. On Debian and Ubuntu, you can install OpenJDK JRE by running
apt-get install openjdk-7-jre
as root. Grab the latest version of STICK from the project's website and unpack the downloaded ZIP archive. In the terminal, switch to the resulting directory, and run the
java -jar stick.jar
command as root.
The process of installing CHDK on an SD card using STICK consists of a few simple steps. To find out the current firmware version of your camera and the appropriate CHDK build for it, drag and drop a photo taken with the camera onto the designated area in STICK (Figure 2). Then, press the Download? button to fetch the correct CHDK distribution and follow the rest of the steps to analyze and prepare the SD card. Lock the prepared card and insert it into the camera. When you power the camera on, you should see the CHDK overlay on top of the regular interface.
Instead of using STICK, you can install CHDK manually, and load it when required. To do this, fetch the correct full CHDK distribution for your specific camera model and firmware [6], extract the downloaded archive, and move its content to the root of the SD card. Insert the card into the camera.
To activate CHDK, start the camera in the Play mode using the PLAY button. Press the MENU button, choose the Firm Update item, and press the FUNC.SET button. Press OK when prompted to update the firmware. This action doesn't actually update the firmware: It simply loads CHDK. Now press the shutter release button to turn the camera on, and you should see the CHDK overlay.
The next step is to create a uBasic intervalometer script for taking a specified number of photos at predefined intervals. The CHDK wiki offers a wide range of simple and advanced intervalometer scripts, including the one that is perfect for this project [7]. Listing 1 contains a slightly tweaked version of this script. Create a new text file, paste the code from Listing 1 into it, and save the file under the intrvl.bas name in the CHDK | SCRIPTS folder on the SD card.
Listing 1
Simple Intervalometer uBasic Script
With all the pieces in place, mount the camera on the DIY panning rig. To launch the script and start the capturing sequence, turn on the camera and press the ALT button (usually it's the PRINT or SHORTCUT button), then FUNC.SET, choose Load Script from File, and use the file browser to select the INTRVL.BAS
script. Then, specify the desired interval, wind up the timer, and press the shutter release button to start the time-lapse session (see the "Practicalities" box).
Practicalities
Before you start a time-lapse session, you might want to make some simple calculations to find out how many photos you need to take. For example, if you take 300 photos and you want the video to play at 30 frames per second, the length of the final movie will be 10 seconds (300/30=10). Provided you set the interval between shots to three seconds, the duration of the time-lapse session will be 15 minutes [(300*3)/60], and that's the value you need to use on the timer. Make sure you use a fully charged battery. If you have access to a wall outlet, you might want to use an AC adapter. Many Canon PowerShot models don't have an external power connector, but you can use a so-called adapter kit (e.g., ACK-DC30 [9] for PowerShot S90 and later models).
When it comes to exposure settings, shooting in the Aperture-priority mode and manual focus is the best option in most situations. This ensures that the final video has consistent depth of field and focus. Also, set your camera to shoot in the JPEG format only and select the medium image size (e.g., 2272x1704, or ~4MP).
Using an Android Camera for Time-Lapse Photography
That's all fine and dandy, but what if you don't have a Canon PowerShot camera? Open source software to the rescue: Using a simple Python script and the Scripting Layer for Android [8] software, you can turn practically any Android smartphone with a decent camera into a time-lapse photo device.
Use your Android smartphone to download the latest sl4a and Python For Android (Py4A) .apk
packages from the project's website, then install both packages on your device. Open the Python For Android app and install Python by pressing the Install button.
On your machine, create a text file, enter the code in Listing 2, and save the file under the intervalometer.py
name and move it to the sl4a | scripts folder on the Android device. To launch the script, start the sl4a app, select the intervalometer.py
script, press the Run button, and specify the number of photos and interval between shots in seconds.
Listing 2
Python Intervalometer Script
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.