cyndilib.sender#

Sender#

class cyndilib.sender.Sender(unicode ndi_name, unicode ndi_groups=u'', bool clock_video=True, bool clock_audio=True)#

Bases: object

Sends video and audio streams

ndi_name#

The NDI® source name to use

Type:

str

ndi_source#

A source object representing the sender

Type:

Source

video_frame#
Type:

VideoSendFrame

audio_frame#
Type:

AudioSendFrame

metadata_frame#
Type:

MetadataSendFrame

clock_video#

True if the video frames should clock themselves. If False, no rate limiting will be applied to keep within the desired frame rate

Type:

bool

clock_audio#

True if the audio frames should clock themselves. If False, no rate limiting will be applied to keep within the desired frame rate

Type:

bool

close(self)#

Close the sender and free all resources

get_num_connections(self, double timeout)#
name#

The current name of the source

This may be different than what was supplied during initialization

open(self)#

Open the sender

preview_tally#

The current preview tally state of the sender

program_tally#

The current program tally state of the sender

send_audio(self)#
send_metadata(self, unicode tag, dict attrs)#
send_metadata_frame(self, MetadataSendFrame mf)#
send_video(self)#
send_video_async(self)#
set_audio_frame(self, AudioSendFrame af)#

Set the audio_frame

set_video_frame(self, VideoSendFrame vf)#

Set the video_frame

update_tally(self, double timeout)#
write_audio(self, float32_t[:, :] data)#

Write the given audio data and send it

Parameters:

data – A 2-d array or memoryview of 32-bit floats with shape (num_channels, num_samples)

write_video(self, uint8_t[:] data)#

Write the given video data and send it

Parameters:

data – A 1-d array or memoryview of unsigned 8-bit integers formatted as described in wrapper.ndi_structs.FourCC

write_video_and_audio(self, uint8_t[:] video_data, float32_t[:, :] audio_data)#

Write and send the given video and audio data

The video data will be sent asynchronously (as described in write_video_async()).

Parameters:
  • video_data – A 1-d array or memoryview of unsigned 8-bit integers formatted as described in wrapper.ndi_structs.FourCC

  • audio_data – A 2-d array or memoryview of 32-bit floats with shape (num_channels, num_samples)

write_video_async(self, uint8_t[:] data)#

Write the given video data and send it asynchronously

This call will return immediately and the required operations on the data will be handled separately by the NDI® library.

Note

This is not an async def function

Parameters:

data – A 1-d array or memoryview of unsigned 8-bit integers formatted as described in wrapper.ndi_structs.FourCC