Time lapse photography with a Canon Powershot G2 on Linux


This is something that’s sort of been bugging me for a while. Not that I really want to do a lot of time lapse photography, per se, but that I want to be able to tell my camera to take a bunch of pictures, say one every 15 seconds for a certain amount of time (which is essentially what time lapse photography is). Out of the box, my ancient PowerShot G2 doesn’t support this. There’s software that can do it for you, but most of it a) costs money and b) runs on Windows. Which is a problem since the only device I have that could potentially use this feature — e.g. something that is mobile — is my laptop, which runs Linux Mint. So, here’s the setup, what I needed was:

  • Remote capture software
  • …that supports automatic, timed images
  • …from an old Canon Powershot
  • …that runs on Linux

Too much to ask? Actually, no.

Google is your friend

The first thing I found — after hitting several photography forums and finding various Windows apps — was Canon Capture. It hits the nail on the head, but indicates that it might not work with older Powershot cameras, including the G3. I figured the chances it would work with my G2 were pretty slim. But it also referenced gPhoto, so I took a look at that.

gPhoto is pretty much everything I could hope for with the small exception that gtkam — which says it’s a “graphical front-end for gphoto” in the documentation doesn’t actually have all the controls available of the commandline interface. It’s really just a memory card browser, which isn’t what I wanted. When I did a apt-cache search gphoto I also found Entangle which is pretty awesome. It lets you remotely capture the camera from your computer — everything you can do on the camera (and then some), you can do inside the app, including take a picture and automatically download it to your computer instead of the camera’s memory card. However, it still falls short of letting you take a bunch of pictures over a period of time, you can trigger the shutter, but you can’t automate that.

Back to gphoto

Finally, I did some more Googling and found this tutorial which uses gphoto’s commandline interface which is really robust. He used a command like this to take a bunch of shots, but acknowledged that your mileage may vary with regard to specific settings and features, whether they are enabled or controllable from gphoto (not all are):

gphoto2 --set-config beep=0 --set-config flashmode=0 --set-config resolution=3 -I 20 -F 3150 --capture-image-and-download --filename "%Y%m%d%H%M%S.jpg"

Well there were a couple things with that that didn’t work. First of all the resolution on the G2 said it wasn’t configurable. And the filename was saving everything as December 31, 1969. But I found that the filename is getting renamed anyway, so I could just drop that and the resolution setting. After some tweaks, this is what I came up with:

gphoto2 --set-config beep=0 --set-config flashmode=0 -I 20 -F 10 --capture-image-and-download

The -I is how many seconds before each snap and the -F is how many pictures to take. This worked great, but I didn’t want to have to enter in a bunch of code and remember all the parameters every time I wanted to do this. So I wrote a bash script.

bashing my head into the keyboard

Bash scripting is not my strong suit. To the uninitiated, bash is the command line language of unix-like operating systems, and a bash script is something that will execute a bunch of stuff on the command line. But you might want to do things like add variables or get user input, so you’d write a script that could do it. I wanted my script to ask how often to shoot and how many shots to take and then start the process. I had to do some research to refresh my memory on how to take user input, but once I did, the script was simple and effective.

The script

echo "How frequent do you want the images (seconds)?"
read seconds
echo "How many images?"
read number
gphoto2 --set-config beep=0 --set-config flashmode=0 -I $seconds -F $number --capture-image-and-download


screenshot 750x437 Advent

This winter holiday blogger template is full of outdoor beauty and cheer with pine branches, red berries, pinecones and fluffy white snow as the background for your tales of happy holiday doings, whether they are sledding, shopping, baking, snowman creation, family meals, caroling, or all of it!

Feel free to contact us if you’re interested in custom BlogSpot templates or just want us to design a custom header graphic for your site.  We’d love to hear from you!

Download Advent

You might also be interested in these:

  1. Thankfull
  2. Grace
  3. Let it Snow

Free Texture Pack: Nature and Wood Textures

We were going through our texture packs and uncovered this one from almost a year ago that got lost in the cracks.  This texture pack is perfect for the Fall months, with several high quality images of dry leaves in orange and yellow and red.  A pair of warm wood textures rounds out the mix.

All our textures are released under a Creative Commons 3.0 Attribution Share-Alike license. Click the license badge below for more information about usage.

88x31 Free Texture Pack: Nature and Wood Textures
Arcane Palette textures by Arcane Palette Creative Design is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.
Based on a work at www.arcanepalette.com.

To download this pack, click the link underneath the previews below.

Download APnature-wood 12MB
downloaded 441 times