EDSDK To Remote Control Your Canon Camera

I was checking out how to do time lapse photography after browsing through YouTube earlier this week.  They have a million videos showing time lapse, this one of a thunderstorm is pretty cool. So, I got to thinking that there ought to be some software that would be able to automagically take the photographs at a given interval.  After checking out a few packages, I didn't feel like paying the money to purchase them, so I got to thinking that if there is software to do it, there ought to be an API to programatically do it myself.

So I found EDSDK, Canon's SDK for interfacing with its cameras.  The download includes all the DLLs you need if developing for Windows, and a separate download if you're developing for the Mac.  It also includes a class in C#, VB.NET, and Visual C++ that act as a bridge for manipulating the camera through the binary DLLs.  The included classes aren't anything much as far as an object oriented class goes, it's mostly just a prototype class from which safer classes can be created.

Which is what I've done.  I have the beginnings of a C# wrapper that encapsulates the EDSDK binaries into a type safe, easy to use module.  As a proof of concept, I created my own Windows Forms application that initializes the wrapper, loads up the connected cameras, and allows you to take photographs.  The other idea that I had for this was to be able to take photographs with a IR remote (like the ones that come with Windows Media Center), but decided that I had an even better device: an iPod Touch.  I then created a socket server and client that allows an ASP.NET application to send a message to the Windows Forms app and take photographs as well.  This allowed me to take pictures using Safari on my iPod Touch.

Later this week I will post my source code, but in order for it to work, you will have to obtain your own copy of the SDK DLLs.  The process was very quick and I received turnaround within a couple of hours (yes, a real person is going to look at your application).  Stay tuned.

UPDATE 09 JAN 2009 16:47

You can download the source code here (4.2MB). Standard disclaimers apply (I don't claim it does anything, won't break anything, cause the world to implode, etc. Use at your own risk, enjoy. If you break something, you get to hold all the pieces).  Remember, I haven't included EDSDK DLLs, you'll need to download your own copy and put them into the 'bin' directory of the CanonCameraApp and CanonCameraAppLib folders.

UPDATE 20 OCT 2009 16:52

Please, before you email me complaining about how your camera does not get detected, check to make sure that  your camera is compatible with EDSDK.  Here's a FAQ put together by Canon on which are compatible.  As a general rule of thumb, EDSDK is only compatible with DSLR cameras like the XT, XTi, XS, XSi, 5D Mark II, etc.  Your dinky little PowerShot? Not compatible.  I know, it sucks, but since I don't own one of those cameras, it makes it difficult to write and test code against them.

Posted on Jan 7
Written by Wayne Hartman