▲ Klaus Brunner’s home

Some Notes on Remotely Controlling Digital Cameras

2006-10-28

I’ve recently had to write a specialised remote control application for a somewhat dated Canon G1, and later adapt it to a Nikon Coolpix 8400 digital camera. There are remote control applications for both cameras, but they didn’t do what we needed in our research project – the idea was to write a small application that would do the trick. Now, it seems that no camera manufacturer feels quite ready for opening up their SDKs or communication specifications, so you’ll have to apply for it and sign some sort of an NDA.

My experience with Canon: getting the Win32 SDK was a matter of signing up at their website, filling out an online application form, and waiting a few hours for approval to download the SDK package. The SDK is fairly easy to use in C, documentation isn’t great but good enough. Writing the application took about a day but could have been even quicker if my C skills hadn’t been so rusty. Canon allows a great deal of control over the camera; you can even shut it down and wake it up on demand (which was quite convenient for us, as we wanted to stop taking pictures during the night). All in all, this was a pleasant experience, even though the G1 is antique by today’s standards and doesn’t support many functions the SDK offers.

Nikon, then, was an altogether different story. First of all, you can’t just get the SDK online. You can’t even apply for it online. You can, however, download two MS Word documents that you’re supposed to print out, fill in, sign, and stuff in an envelope addressed to Nikon UK. A mere four weeks later, you get a brief e-mail from Nikon announcing that finally someone has gotten around to opening the envelope and reading your application and maybe someone else will get around to processing it within another four weeks, which may or may not result in you getting the SDK at some unspecified time in the future, but please don’t call us, we call you, thanks very much. Some six weeks later, just after you have lost all hope, a padded envelope arrives containing nothing but a CD-ROM with "E8400 SDK" scribbled on it. So far, so good. The SDK, it turns out, is nothing like Canon’s. The documentation is incomplete and outdated, the API is over-generalised so that doing the simplest things takes outrageous amounts of code, the supplied C sample application is a huge mess. Sometimes the camera seems to just freeze up – this also happened with the Canon, but then you could just shut it down and start it up again remotely. When the Nikon freezes, it apparently needs a power cycle.

It should be noted that the Nikon camera supports PTP, which is even supported to some extent by Microsoft’s free WIA Automation. This is a very high-level library that allows you to control some basic functionality of PTP-compliant digital still cameras and scanners. Indeed, connecting the camera and taking a picture is quite simple. However, I couldn’t get it to set the shooting parameters properly, which is probably due to being vendor-specific functionality that isn’t documented anywhere. WIA Automation itself isn’t documented very exhaustively and generally does not seem to be a high-priority project for Microsoft.

I also looked into developing the application on Linux instead of Windows, based on libgphoto. Unfortunately the Nikon isn’t supported by gphoto (which even crashed when trying to take a picture).

Conclusion

If you’re looking for a camera that’s easy to hack for remote control applications, Nikon may not be your best choice. Wish I had known this before.

Creative Commons License
This work is licenced under a Creative Commons Licence by its author Klaus A. Brunner.