Skip to main content

Module image_encoding

Module image_encoding 

Source
Expand description

Still images from video frames: the image-encoding feature.

ImageOptions selects PNG, JPEG, lossless or lossy WebP, plus color, alpha, bit depth and reduction settings. Every VideoSource exposes encode_image, encode_image_to and encode_image_data_url. ImageWorkspace reuses conversion storage across repeated encodes.

Encoding validates the frame and options before writing output. By default, YUV input uses the matrix in readable ndi_color_info, or BT.709 limited range when untagged. The SDK’s own YUV-to-RGB conversion always uses BT.709 limited range, ignoring that tag. RGB-received frames already carry that conversion. The tag still controls color admission and a PNG’s cICP chunk. Receive YUV when its tagged matrix or original HDR code values matter; see the color and HDR guidance on ImageOptions.

Structs§

ImageOptions
How a video frame is encoded as a still image: its format, color handling, bit depth, alpha, HDR policy, size and codec effort.
ImageWorkspace
Reusable conversion storage for still-image encoding.

Enums§

AlphaMode
Whether a PNG or WebP image has an alpha channel.
ColorPolicy
How YUV frames are converted to RGB.
Downscale
How much an image is reduced in each direction.
HdrPolicy
What happens to a frame whose ndi_color_info gives the PQ or HLG transfer function. Frames with BT.2020 primaries or either HDR transfer need a color tag, which the encoder can write only in PNG.
ImageFormat
The image format a video frame is encoded to.
PngCompression
How hard PNG compresses.
SampleDepth
The bits a channel of an encoded image.
YuvRange
The range of a YUV frame’s code values.