Skip to content

pychdk: streaming a DNG needs the header and the raw data assembled client-side #331

Description

@juancobo

ChdkDevice.shoot(dng=True, stream=True) asks CHDK for REMOTE_CAP_RAW | REMOTE_CAP_DNG_HDR and then downloads a single format, so what comes back is not a usable DNG file. As of v0.1.1 the combination raises NotImplementedError naming what is missing, rather than returning a partial file, and this issue records the work the refusal points at.

CHDK's core/ptp.h describes the pieces: the DNG flag yields "DNG header. The header will be DNG version 1.3. Does not include image data, clients wanting to create a DNG file should also request RAW", while the RAW flag yields "Raw framebuffer data, in camera native format". PTP_CHDK_RemoteCaptureGetData takes a bit indicating which data type to fetch and reports "0 = no more chunks of selected format", so each format is a separate download loop over the chunk protocol that v0.1.1 now implements correctly.

What implementing it involves

  • Two download loops, one per format, driven from the readiness bitmask rather than one call.
  • Assembling a DNG from the header and the raw framebuffer, including the byte-order handling CHDK's own clients apply to the raw data.
  • A camera to test against: chdkptp is the reference for what a correct file looks like, but nothing short of opening the result in a raw converter proves it.

Priority

Low, and not on the path of the CHDK camera backend (#304), which captures JPEG. The Canon A2500 bodies the toolkit uses have no native raw support, so this matters only if a future camera does, or if a DNG workflow is ever wanted for preservation masters.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions