Configure_source_for_ntp_sync Python Binding DeepStream

Hello,

I noticed that by default, the timestamp recorded under frame_meta.ntp_timestamp (from NvDsFrameMeta) is the time when the frame data is batched by nvstreammux.

In cases where we have many cameras and cannot handle the predictions in real-time, without setting drop-on-latency to true for rtspsrc, the timestamp of the frame data and the actual time that it reaches NVStreammux can deviate significantly, which affects data integrity.

However, if drop-on-latency is set to true, this results in artifacts in the video stream, which drastically impacts the inference pipelines predictive capabilities (for both PGIE and SGIE).

To handle this issue, I wanted to retrieve the timestamp attached to rtspsrc as described here. However, the documentation states that Gst pointer needs to be passed to the configure_source_for_ntp_sync() function, so I guess something like this: configure_source_for_ntp_sync(hash(gst_rtsp_src)).

My question is:

Are there any python bindings for configure_source_for_ntp_sync()?

Hello, ljay189
You can use the ctypes library like this:

import ctypes

GST_HELPER_LIB = ctypes.CDLL(
    "/opt/nvidia/deepstream/deepstream/lib/libnvdsgst_helper.so"
)

GST_HELPER_LIB.configure_source_for_ntp_sync(hash(gst_rtsp_src))

Set the attach-sys-ts config parameter to 0 in streammux and make sure RTSP source can send RTCP Sender Reports

1 Like

Thank you very much for the response!

I was wondering in case, the RTSP source is unable to send RTCP Sender Reports (I am guessing some cameras do not support it), is there a way to catch, read a signal that the sender report is not available?

I want to do something like the following:


rtsp_sender_report_available = True
for rtsp_src in rtsp_sources: 
    if rtsp_src does not support rtsp sender report:
        rtsp_sender_report_available = False
        break

if rtsp_sender_report_available:
    attach_sys_ts = 0
else:    
    attach_sys_ts = 1
streammux.set_property('attach-sys-ts', attach_sys_ts)

Which version do you use for deepstream? You can add the required binding function by yourself with our latest version. The binding code is open source now. You can refer the link below:
https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/bindings

Thank you for the response. I am using DeepStream version 6.1

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