cyndilib.sender#
Sender#
- class cyndilib.sender.Sender#
Bases:
objectSends video and audio streams
- video_frame#
- Type:
- audio_frame#
- Type:
- metadata_frame#
- Type:
- 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:
- 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:
- close(self)#
Close the sender and free all resources
- get_num_connections(self, timeout: float)#
Get the current number of receivers connected to this source
This can be used to avoid even rendering when nothing is connected.
If you specify a timeout that is not 0, this method will block for the given amount of time (in seconds) until there are connections (or the timeout was reached).
- 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 audio data (if available) that was previously written to the
audio_frameusing itswrite_data()method.Note
This method is available for flexibility, but using the
write_audio()orwrite_audio_async()methods may be more desirable as the audio data will be buffered and sent with a single method call.
- send_metadata_frame(self, mf: MetadataSendFrame)#
- send_video(self)#
Send a frame of video data (if available) that was previously written to the
video_frameusing itswrite_data()method.Note
This method is available for flexibility, but using the
write_video()orwrite_video_async()methods may be more desirable as the video data will be buffered and sent with a single method call.
- send_video_async(self)#
Send a frame of video data as described in
send_video()asynchronouslyThis call will return immediately and the required operations on the data will be handled separately by the NDI® library.
Note
This method is available for flexibility, but using the
write_video()orwrite_video_async()methods may be more desirable as the video data will be buffered and sent with a single method call.Note
This is not an
async deffunction. In this context, “async” only describes how the NDI® library handles processing and syncronization.
- set_audio_frame(self, af: AudioSendFrame)#
Set the
audio_frame
- set_video_frame(self, vf: VideoSendFrame)#
Set the
video_frame
- update_tally(self, timeout: float)#
Request an update on the current tally state
The tally state will then be reflected on the
program_tallyandpreview_tallyattributes of thesource.If timeout is non-zero, this method will block for the given amount of time (in seconds) until a change in tally state (or the timeout was reached).
- write_audio(self, data: float32_t[:,_:])#
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, data: uint8_t[:])#
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, video_data: uint8_t[:], audio_data: float32_t[:,_:])#
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.FourCCaudio_data – A 2-d array or memoryview of 32-bit floats with shape
(num_channels, num_samples)
- write_video_async(self, data: uint8_t[:])#
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 deffunction. In this context, “async” only describes how the NDI® library handles processing and syncronization.- Parameters:
data – A 1-d array or memoryview of unsigned 8-bit integers formatted as described in
wrapper.ndi_structs.FourCC