Is it possible to associate frames from the same rtsp source in two separate applications based on ntp timestamp?

• Hardware Platform (Jetson / GPU) - dGPU
• DeepStream Version - 6.2
• JetPack Version (valid for Jetson only)
• TensorRT Version - 8.5.2.2
• NVIDIA GPU Driver Version (valid for GPU only) - 530.xx.
• Issue Type( questions, new requirements, bugs) - question

Hi Team, I just have a question. If I have two separate instances of the same deepstream application reading from the same rtsp source, can the frames in both the apps be matched based on the ntp timestamps? i.e. do they have the exact same ntp timestamps in frame_meta->ntp_timestamp? I know how to configure ntp timestamp in deepstream following this.
However the ntp timestamps of the corresponding frames I receive in two different apps pointing to the same rtsp source are not exactly same, they differ in millisec. Is it the expected behavior?
Two questions:

  1. Is it not possible to associate frames from the same rtsp source in two diff. apps based on ntp timestamp?
  2. I also see this warning in the application.
Warning: gst-library-error-quark: Either host or Source 0 seems to be out of NTP sync          SYS TIME = 2023-05-24T12:53:43.035Z CALCULATED NTP TIME = 2023-05-24T18:23:43.419Z (5): gstnvstreammux_ntp.cpp(108): check_if_sys_rtcp_time_is_ntp_sync (): /GstPipeline:pipeline0/GstNvStreamMux:Stream-muxer

Kindly clarify on these questions.

Thanks,
Arivarasan

Hi Team,

Any lead on this please.

If you use attach-sys-ts to attach host system time as NTP timestamp, you may get different ntp timestamp with the two different instances.

If you just get the ntp timestamp from the original RTCP SR from the RTSP server, the ntp timestamp is always the same as it is provided by the RTSP server.

Hi @Fiona.Chen ,

I have already set attach-sys-ts to false in the nvstreammux config. Attaching the code for your reference.
ntp_ds.py (19.8 KB)

This log just tells you that your device which runs the RTSP client(the DeepStream app) is not clock synchronized with the system(the device which generate the RTSP stream and RTCP SR). RFC 3550: RTP: A Transport Protocol for Real-Time Applications

Hi,
Any idea on how to synchronize the clock of the device with the system that generates the rtsp streams?

Thanks,
Arivarasan

It is not DeepStream related. Network Time Protocol - Wikipedia

It may not. But if you know how to fix this, sharing would be helpful.

It is not an error, no fix is needed.
For NTP clock synchronization solution, maybe you can refer to Network Time Protocol - Wikipedia or you can search for other resources.

We only focus on DeepStream in this forum.

Can you please let me know what this function check_if_sys_rtcp_time_is_ntp_sync ()does. I think this function is able to identify that the clock is not synchronized. Can you please share how this is checked?

Yes.

When you use DeepStream app as the RTSP client to receive the stream, the device you run the DeepStream app in will be treated as a network node. So the system time is the node time. We will compare it with the NTP timestamp from the RTCP SR (which is the time generated by the device who sends the RTSP stream), if the gap is larger than 10 seconds, the warning will be printed out.

This helps, thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.