cyndilib.video_frame#

VideoFrame#

class cyndilib.video_frame.VideoFrame(*args, **kwargs)#

Bases: object

Base class for video frames

fourcc#

The current FourCC format type

get_buffer_size(self)#
get_data_size(self) size_t#
get_format_string(self) unicode#

Get the video format as a string based off of resolution, frame rate and field format (“1080i59.94”, etc)

get_fourcc(self)#

Get the FourCC format type

get_frame_rate(self) Fraction#

Get the video frame rate

get_line_stride(self)#
get_resolution(self)#

Get the video resolution as a tuple of (width, height)

get_timecode_posix(self)#

Get the current timecode converted to float seconds (posix)

get_timestamp_posix(self)#

Get the current timestamp converted to float seconds (posix)

set_fourcc(self, FourCC value)#

Set the FourCC format type

set_frame_rate(self, value: Fraction)#

Set the video frame rate

set_resolution(self, int xres, int yres)#

Set the video resolution

xres#

X resolution (width)

yres#

Y resolution (height)

VideoRecvFrame#

class cyndilib.video_frame.VideoRecvFrame(*args, **kwargs)#

Bases: VideoFrame

Video frame to be used with a receiver.Receiver

Parameters:

max_buffers (int, optional) – The maximum number of items to store in the buffer. Defaults to 4

Incoming data from the receiver is placed into temporary buffers so it can be read without possibly losing frames.

The buffer items retain both the frame data and corresponding timestamps. They can be read using the fill_p_data() method or using the buffer protocol.

buffer_full(self) bool#

Returns True if the buffers are all in use

fill_p_data(self, uint8_t[:] dest)#

Copy the first buffered frame data into the given destination array (or memoryview).

The array should be typed as unsigned 8-bit integers sized to match that of get_buffer_size()

get_buffer_depth(self) int#

Get the number of buffered frames

get_view_count(self)#
skip_frames(self, bool eager)#

Discard buffered frame(s)

If the buffers remain full and the application can’t keep up, this can be used as a last resort.

Parameters:

eager (bool) – If True, discard all buffered frames except one (the most recently received). If False, only discard one frame

Returns the number of frames skipped

VideoFrameSync#

class cyndilib.video_frame.VideoFrameSync#

Bases: VideoFrame

Video frame for use with framesync.FrameSync

Unlike VideoRecvFrame, this object does not store or buffer any data. It will always contain the most recent video frame data after a call to framesync.FrameSync.capture_video().

This is by design since the FrameSync methods utilize buffering from within the NDI® library.

Data can be read using the get_array() method or by using the buffer protocol.

get_array(self)#

Get the video frame data as an numpy.ndarray of unsigned 8-bit integers

VideoSendFrame#

class cyndilib.video_frame.VideoSendFrame#

Bases: VideoFrame

Video frame for use with sender.Sender

Note

Instances of this class are not intended to be created directly nor are its methods. They are instead called from the sender.Sender write methods.

destroy(self)#
get_write_available(self)#
write_data(self, uint8_t[:] data)#