Capturing Images using PTP/IP on Canon EOS Cameras
When I started working on incorporating Canon EOS cameras into my CineRemote app, I quickly stumbled over the inability of my Canon EOS 70D to record movies once WiFi is enabled.
As a result, I thought about ditching support for Canon EOS cameras, but in the end, I still took up the challenge and implemented the next best thing: Wireless shutter release.
This post describes how you can capture images and control the capture destination using the PTP/IP protocol.
Set Capture Destination
When controlling a Canon EOS Camera remotely using PTP/IP, by default, the camera only saves the captured image to volatile memory so the connected client can request the image bytes.
With the help of the SetPropValue operation introduced in the previous post, you can alter this behaviour.
For my Canon 70D, I must set the property 0xd11c
(CaptureDestination) to 0x2
so the images are stored on the SD card.
Image Capture Sequence
The image-capturing sequence is analogous to the manual release sequence you would perform using the camera’s shutter button. Half-pressing the shutter button starts the autofocus, and full-pressing the button triggers the image release.
To enable the autofocus, send a StartImageCapture
(0x9128) operation request with the first parameter set to Focus
(0x01) and a second parameter of unknown meaning set to 0x0
.
On success, this operation and all subsequent requests respond with an okay (0x2001) operation response.
Start the image release using another StartImageCapture
(0x9128) operation request, but this time, set the first parameter to Release
(0x02).
Stop capturing the image by sending a StopImageCapture
(0x9129) operation request with a single parameter set to Release
(0x2).
Lastly, stop the autofocus using a StopImageCapture
(0x9129) operation with the parameter set to Focus
(0x1).
And that is all you need to know for capturing images on Canon EOS cameras using PTP/IP.
The next and likely last post of this series will explain how to request LiveView images from the camera.