cyndilib.wrapper.ndi_structs#

FrameType#

class cyndilib.wrapper.ndi_structs.FrameType(enum.Enum)#

Enum signifying NDI® frame types

unknown#

Effectively means that the frame type is None

video#

Specifies a VideoFrame

audio#

Specifies an AudioFrame

metadata#

Specifies a MetadataFrame

error#

Indicates an error occurred (when returned from an NDI® function)

FrameFormat#

class cyndilib.wrapper.ndi_structs.FrameFormat(enum.Enum)#

Enum specifying the field type of a video frame

progressive#

A progressive frame (non-fielded)

interleaved#

A fielded (interlaced) frame using field 0 for even lines and field 1 for odd

field_0#

Indicates the current data contains the even field

field_1#

Indicates the current data contains the odd field

FourCC#

class cyndilib.wrapper.ndi_structs.FourCC(enum.Enum)#

Enum specifying various FourCC types for video formats

UYVY#

Non-planar YCbCr format using 4:2:2. For every two pixels there are two Y samples and one of each color samples.

The ordering for these is (U0, Y0, V0, Y1) where each component is uint8.

line stride

xres * sizeof(uint8_t) * 4

Size in bytes

line_stride * yres

UYVA#

Planar YCbCr + Alpha format using 4:2:2:4. The first plane is formatted as in UYVY and the second plane contains the alpha value for each pixel as uint8.

line stride
First Plane

xres * sizeof(uint8_t) * 4

Second Plane

xres * sizeof(uint8_t)

Size in bytes
First plane

xres * sizeof(uint8_t) * 4 * yres

Second plane

xres * sizeof(uint8_t) * yres

P216#

Semi-planar YCbCr format using 4:2:2 with 16bpp. The first plane contains the Y values with one uint16 sample for every pixel. The second plane contains the color samples as interleaved pairs within a single uint16 per pixel.

The ordering for the second plane may be simpler to describe as (<uint8_t>U, <uint8_t>V).

line stride
First plane (Y)

xres * sizeof(uint16_t)

Second plane (UV)

xres * sizeof(uint8_t) * 2 (note this is the same as the first plane)

Size in bytes (per plane)

xres * sizeof(uint16_t) * yres

PA16#

Semi-planar YCbCr + Alpha format using 4:2:2:4. The first two planes are formatted as described in P216 and the third plane contains the alpha value for each pixel as uint16.

line stride (per plane)

xres * sizeof(uint16_t)

Size in bytes (per plane)

xres * sizeof(uint16_t) * yres

I420#

Planar YCbCr format using 4:2:0 video format with 8bpp. The first plane contains the Y values with one uint8 sample for every pixel. The second plane contains the Cb (U) samples and the third contains the Cr (V) values (also as uint8).

Since chroma subsampling is done both horizontallly and vertically, the ordering may be best described here: https://wiki.videolan.org/YUV#I420

line stride
First plane

xres * sizeof(uint8_t)

Second and third planes

xres / 2 * sizeof(uint8_t)

Size in bytes
First plane

xres * sizeof(uint8_t) * yres

Second and third planes

xres / 2 * sizeof(uint8_t) * yres / 2

YV12#

Identical to YV12, except the order of the chroma pairs are reversed (hence the name “YV”) making the plane order (Y, Cr, Cb) or (Y, V, U).

NV12#

Planar YCbCr format using 4:2:0 with 8bpp. The first plane contains the Y samples as uint8 and the second contains the chroma pairs as interleaved uint8.

As with I420 and YV12, the chroma subsampling is done within 2x2 groups of pixels and can be described here: https://wiki.videolan.org/YUV#NV12

Instead of using separate (smaller) planes for the UV components, they are combined into a single plane with the same size as the Y plane.

line stride (both planes)

xres * sizeof(uint8_t)

Size in bytes (both planes)

xres * sizeof(uint8_t) * yres

RGBA#

Non-planar RGBA format using 4:4:4:4. For each pixel, the red, green, blue and alpha components are stored using one uint8 value for each (ordered as (R, G, B, A)).

line stride

xres * sizeof(uint8_t) * 4

Size in bytes

xres * sizeof(uint8_t) * 4 * yres

RGBX#

Like RGBA but with no alpha component. Values of 255 are inserted in its place.

BGRA#

Like RGBA except the components are ordered as (B, G, R, A)

BGRX#

Like BGRA but with no alpha component