cyndilib.framesync#
FrameSync#
- class cyndilib.framesync.FrameSync#
Bases:
objectA 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
Receiverand 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_frameReturns 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_frameReturns 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:
ThreadA thread designed for use with
FrameSyncThis can be used to handle video and audio using two separate threads. One thread would be set to use
recv_videoand the other torecv_audio.- Parameters:
frame_sync (FrameSync) – The FrameSync instance
ft (ReceiveFrameType) – The type(s) of frames to receive (either
recv_videoorrecv_audio)
- worker#
Either a
VideoWorkerorAudioWorker- 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:
objectWorker 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:
FrameSyncWorkerWorker used by
FrameSyncThreadfor video frames
AudioWorker#
- class cyndilib.framesync.AudioWorker#
Bases:
FrameSyncWorkerWorker used by
FrameSyncThreadfor audio frames