Live video streaming Latency Measurement

Live video streaming Latency Measurement

Postby XiaoMI » Wed Feb 28, 2024 11:16 pm

I plan to use the following diagram to measure the latency of live video streaming from a smart camera? Can it be done with your system? Any recommendation?
RoundTripLatencyTest.png
RoundTripLatencyTest.png (172.25 KiB) Viewed 32142 times
XiaoMI
 
Posts: 3
Joined: Wed Feb 28, 2024 8:11 pm

Re: Live video streaming Latency Measurement

Postby VirtinsTech » Fri Mar 01, 2024 5:16 pm

Sure. You can use Multi-Instrument together with a sound card with at least two input channels and one output channel to do it, as shown in the diagram below.

CrossCorrelation.png
CrossCorrelation.png (71.88 KiB) Viewed 32116 times


The test signal output to the speaker should be looped back to one input channel as the time reference. The other input channel should be connected to a mic to capture the live sound streamed from the network.

Cross Correlation function of Multi-Instrument can be used to measure the time difference between the two input channels, if the test signal is a wide band signal such as white noise and MLS.

Generalized Cross Correlation function of Multi-Instrument can be used instead for test signals that are not that "white", such as music and speech.

The loopback cable can be physical or virtual. Some sound cards feature a built-in software loopback switch. Once turned on, the output stream will join in the input stream linearly, and the final input will the sum of both. As both output channels will be looped back, the output signal looped back to the mic input should be set to 0 to effectively disconnect this route of loopback, leaving only the other pair of input and output channels connected as a loopback (see figure below). In this regard, VT RTA-268A/B (https://www.virtins.com/VT-RTA-268ABC.shtml) is recommended.

loopback.png
loopback.png (61.02 KiB) Viewed 32116 times
VirtinsTech
Site Admin
 
Posts: 290
Joined: Tue Oct 01, 2013 3:06 pm

Re: Live video streaming Latency Measurement

Postby XiaoMI » Wed Mar 13, 2024 11:06 am

I've got my VT RTA-268A. I want to use the generalized cross correlation function to measure the latency using music, because my video broadcast system has noise removal feature, so white noise does not work for my case. When I clicked the TDgcc button in the third toolbar to load the corresponding panel setting, I noted that the signal generator was still configured to generate white noise. How to use music instead?
XiaoMI
 
Posts: 3
Joined: Wed Feb 28, 2024 8:11 pm

Re: Live video streaming Latency Measurement

Postby VirtinsTech » Mon Mar 18, 2024 7:02 pm

You can replay a music WAV file by selecting "WaveFile" in the Signal Generator of MI. Be sure to set the Output Amplitude of Ch.A to zero to effectively cut off this route of loopback.

Alternatively, you can playback music using other software such as Windows Media Player or Youtube. To cut off the loopback for Ch.A, go to Windows Sound Playback Control Panel, right click the default sound card for playback, and select "Levels">"Balance", slide the left channel to 0%.
VirtinsTech
Site Admin
 
Posts: 290
Joined: Tue Oct 01, 2013 3:06 pm

Re: Live video streaming Latency Measurement

Postby XiaoMI » Fri Apr 19, 2024 10:58 pm

Many thanks for the help.

I have been using the TDgcc settings of RTA-268A for live video streaming latency monitoring. I tested many music and songs. It worked very well. However, I noticed that the software provided wrong measurements occasionally for some music, for instance, this slow piano solo at Youtube - https://www.youtube.com/watch?v=Rc63ZhEcCI4. In this test, I placed the mic only a few centimeters before the speaker where the music was being replayed. So the latency would be less than 1 ms. Then I used the TDgcc settings to monitor the latency continuously, sometimes the measured latency was correct, but sometimes it was not, I attach one picture here.

SlowPianoIssue.png
SlowPianoIssue.png (78.59 KiB) Viewed 31667 times
XiaoMI
 
Posts: 3
Joined: Wed Feb 28, 2024 8:11 pm

Re: Live video streaming Latency Measurement

Postby VirtinsTech » Wed Apr 24, 2024 2:16 am

While Generalized Cross Correlation (GCC) doesn't necessitate a flat or white spectrum in the test signal for accurate time delay measurement, unlike standard Cross Correlation, it remains ineffective with periodic signals or those containing strong periodic components. For instance, when applied to two sine waves of identical frequency, GCC invariably produces a correlation peak within one signal period around t = 0 (see example below). Consequently, if the test signal possesses a prominent periodic component, this peak might overshadow the true peak, resulting in erroneous time delay measurement. Multi-Instrument boasts a unique and enhanced GCC algorithm, which enhances the robustness of time delay measurement, even in scenarios where the test signal exhibits some periodicity.

1kSinewave.png
1kSinewave.png (68.68 KiB) Viewed 31563 times


In contexts such as slow piano solos, where individual keystrokes are often spaced out, each keystroke generates a signal that is nearly periodic. The default record length of TDgcc is set to 1 second, occasionally capturing only a single keystroke for GCC analysis, thus leading to erroneous measurements. To mitigate this issue, consider extending the Record Length to capture multiple keystrokes in one Oscilloscope frame, effectively disrupting the periodicity of the signal. We changed the record length and FFT size of TDgcc to 4s and 524288 respectively. Then using the new settings, we continuously monitored the latency of the slow piano solo you mentioned. The measured latency was very stable without a single error throughout the entire duration of the music (see example below).

Test.png
Test.png (227.2 KiB) Viewed 31563 times
VirtinsTech
Site Admin
 
Posts: 290
Joined: Tue Oct 01, 2013 3:06 pm


Return to Questions

Who is online

Users browsing this forum: No registered users and 3 guests