Exploring the PTP/IP Protocol

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.

1
Start Autofocus

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.

Start Autofocus Operation
1a
00
00
00
06
00
00
00
01
00
00
00
28
91
11
00
00
00
01
00
00
00
00
00
00
00
Offset
Type
Description
0
Uint32
Length: 26 bytes
4
Uint32
Packet Type: Operation Request (0x06)
8
Uint32
Data Phase: No Data
12
Uint16
Operation: StartImageCapture (0x9128)
14
Uint32
Transaction Id: 17
18
Uint32
CapturePhase: Focus (0x01)
22
Uint32
Unknown Property

On success, this operation and all subsequent requests respond with an okay (0x2001) operation response.

2
Start Image Release

Start the image release using another StartImageCapture (0x9128) operation request, but this time, set the first parameter to Release (0x02).

Start Image Release Operation
1a
00
00
00
06
00
00
00
01
00
00
00
28
91
12
00
00
00
02
00
00
00
00
00
00
00
Offset
Type
Description
0
Uint32
Length: 26 bytes
4
Uint32
Packet Type: Operation Request (0x06)
8
Uint32
Data Phase: No Data
12
Uint16
Operation: StartImageCapture (0x9128)
14
Uint32
Transaction Id: 18
18
Uint32
CapturePhase: Release (0x02)
22
Uint32
Unknown Property
3
Stop Image Release

Stop capturing the image by sending a StopImageCapture (0x9129) operation request with a single parameter set to Release (0x2).

Stop Image Release Operation
16
00
00
00
06
00
00
00
01
00
00
00
29
91
13
00
00
00
02
00
00
00
Offset
Type
Description
0
Uint32
Length: 22 bytes
4
Uint32
Packet Type: Operation Request (0x06)
8
Uint32
Data Phase: No Data
12
Uint16
Operation: StopImageCapture (0x9129)
14
Uint32
Transaction Id: 19
18
Uint32
CapturePhase: Release (0x02)
4
Stop Autofocus

Lastly, stop the autofocus using a StopImageCapture (0x9129) operation with the parameter set to Focus (0x1).

Stop Autofocus Operation
16
00
00
00
06
00
00
00
01
00
00
00
29
91
14
00
00
00
01
00
00
00
Offset
Type
Description
0
Uint32
Length: 22 bytes
4
Uint32
Packet Type: Operation Request (0x06)
8
Uint32
Data Phase: No Data
12
Uint16
Operation: StopImageCapture (0x9129)
14
Uint32
Transaction Id: 20
18
Uint32
CapturePhase: Focus (0x01)

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.