Genlock
// We are going to start by creating an NDI genlock instance
NDIlib_source_t src_name(< Insert your NDI source here >);
NDIlib_genlock_instance_t p_genlock = NDIlib_genlock_create(&src_name,
NULL/* Note that your vendor JSON is required here */);
// We are now going to loop and genlock to the signal at 59.94Hz
while (<Your application is running>) {
// Setup the frame header.
NDIlib_video_frame_v2_t frame;
frame.frame_rate_N = 60000;
frame.frame_rate_D = 1001;
frame.frame_format_type = NDIlib_frame_format_type_progressive;
// We wait for a frame to send
const bool genlock_locked = NDIlib_genlock_wait_video(p_genlock, &frame);
printf("Send a frame, currently locked to %s.\n", genlock_locked ? "remote source"
: "system clock");
}
NDIlib_genlock_destroy(p_genlock);Last updated
Was this helpful?

