cyndilib.framesync
#
FrameSync#
- class cyndilib.framesync.FrameSync#
Bases:
object
A wrapper around the NDI® frame synchronization module
When receiving streams, the frame sync methods in the NDI® library use various buffering and clock-timing techniques to keep video and audio data in sync with each other.
Timing “jitter” between capture calls is also accounted for which reduces the amount of critically-timed application code as compared to the direct approach needed for
Receiver
.Note
Instances of this class are automatically created by the
Receiver
and therefore not intended to be created directly.- video_frame#
- Type:
- audio_frame#
- Type:
- capture_audio(self, size_t no_samples) int #
Capture available audio samples up to no_samples
After this call, the captured data will be available in the
audio_frame
Returns the number of samples captured
- capture_available_audio(self) int #
Capture all available audio samples
After this call, the captured data will be available in the
audio_frame
Returns the number of samples captured
- capture_video(self, FrameFormat fmt=FrameFormat.progressive)#
Capture video
After this call, the captured data will be available in the
video_frame
- set_audio_frame(self, AudioFrameSync audio_frame)#
Set the
audio_frame
- set_video_frame(self, VideoFrameSync video_frame)#
Set the
video_frame
FrameSyncThread#
- class cyndilib.framesync.FrameSyncThread(frame_sync, ft)#
Bases:
Thread
A thread designed for use with
FrameSync
This can be used to handle video and audio using two separate threads. One thread would be set to use
recv_video
and the other torecv_audio
.- Parameters:
frame_sync (FrameSync) – The FrameSync instance
ft (ReceiveFrameType) – The type(s) of frames to receive (either
recv_video
orrecv_audio
)
- worker#
Either a
VideoWorker
orAudioWorker
- Type:
- remove_callback(self)#
- run(self)#
- set_callback(self, cb)#
Set the callback
- stop(self)#
Stop the thread
FrameSyncWorker#
- class cyndilib.framesync.FrameSyncWorker(FrameSync frame_sync)#
Bases:
object
Worker for
FrameSyncThread
- callback#
Callback triggered when a new frame is available
- Type:
Callback
- frame_rate#
The current frame rate
- Type:
VideoWorker#
- class cyndilib.framesync.VideoWorker#
Bases:
FrameSyncWorker
Worker used by
FrameSyncThread
for video frames
AudioWorker#
- class cyndilib.framesync.AudioWorker#
Bases:
FrameSyncWorker
Worker used by
FrameSyncThread
for audio frames