Blogs

Synchronizing Multiple Input Channels with Magewell Capture Cards

2021.06.30

Synchronizing multiple video and audio sources is an important consideration in media workflows ranging from broadcast production to Pro AV. Video walls are an easy-to-understand example of the potential for synchronization problems, particularly with multiple screens displaying a single large image that is spliced together from multiple signals. If the source signals or streams received by the screens are not synchronized, the combined presented image will have visible artifacts or timing errors where portions of the video are not aligned spatially or temporally.

Many methods and technologies have been used successfully for different types of synchronization in various workflows. In broadcast production, genlock technology has been used for many years – dating back to the analog era – to synchronize the clock frequencies of multiple sources to a chosen reference signal. Timecode has been used to synchronize sources across multiple frames, while PTP (Precision Time Protocol) provides clock synchronization in computer network environments.

However, in the context of video capture cards, is there a better way to achieve synchronization of multiple AV channels? We will focus on this topic in this article.

Clock reference

In a computer-based video capture workflow, the capture card brings external video signals into the CPU of the host system in units of frames or fields, and then delivers them to software applications for subsequent operations. In this process, the application needs to implement synchronization based on the timestamp of the video signal.

Most software developers know that while the operating system can stamp time information on the video signal, this time data may not be accurate. If the capture card itself can timestamp the video signal, this problem can be overcome. Magewell capture cards include an onboard crystal oscillator that can provide an independent hardware clock for each capture channel. Each captured video frame will be timestamped in units of 100 nanoseconds (for example, a stamp of 15 means 1500ns). The timestamps of frames from multiple inputs can then be used to synchronize those channels.

To obtain the precise data timestamped by the onboard crystal oscillator, software developers need to call APIs in Magewell's MWCapture SDK. Since the clocks of each capture channel are independent, they must first be set to the same reference value to achieve multi-channel synchronization. Before starting the capture, the application must first obtain the current clock value of a chosen capture channel, and then set it as the clock value for the other capture channels. (For example, if there are four capture channels, the software should first obtain the clock value of channel 1 through the API, and then set the clock value for channels 2, 3, and 4 to the same value).

After the hardware clocks of each capture channel are synchronized, each channel can be time-stamped based on the same clock, and the software can use the timestamp of channel 1 as the benchmark. If the difference between the timestamp of another channel's latest frame and the benchmark is within a certain range, then it can be considered that the frames (such as all four frames captured across four channels in our earlier example) are in sync and belong to the same image.

This same approach can be used to synchronize the capture across all inputs of one multi-channel Magewell capture card (for example, a Pro Capture Quad SDI) or across multiple Magewell capture cards installed in the same host computer.

For more information, please refer to the developers' article How to Splice Videos when Multiple Channels Are Being Captured