Deepstream Application Latency of about 25 secs

Deepstream version 6.2
python version 3.8.10
devices : T4(tesla) dGPU
tensorRT version: 8.5.2
pyds version: 1.1.6

Our Deepstream Application consists of 2 pgie models and 2 sgie models (all our Yolov8 detectors). And we are using nvDCFtracker for tracking. This is our pipeline architecture:

nvurisrcbin -> streammux -> queue -> nvvideoconvert -> capsfilter -> pgie1 -> queue -> pgie2 -> nvtracker -> queue -> sgie1 -> queue -> sgie2 -> demux -> queue -> nvvideoconvert -> capsfilter -> queue -> nvdsosd -> queue -> nvvideoconvert -> capsfilter -> nvvl2h264enc -> h264parse -> queue -> mpegtsmux -> queue -> hlssink

We added the following properties in respective elements to reduce the latency:

nvurisrcbin.set_property(“latency”, 200)
nvurisrcbin.set_property(“udp-buffer-size”,1048576)
nvurisrcbin.set_property(“num-extra-surfaces”,2)
nvurisrcbin.set_property(“drop-frame-interval”,2)

We are using New-Nvstreammux
Batch size for streammux=no. of sources, and Adaptive Batching is on

streammux.set_property(“sync-inputs”,1)
streammux.set_property(“max-latency”,200)

For all the nvvideoconvert we have set nvbuf-memory type to “NVBUF_MEM_CUDA_UNIFIED”

Even after setting the above properties we are getting a latency of about 20 to 25 secs in the starting of the pipeline and it is getting maintained throughout. What changes can be done in our pipeline in order to reduce this latency. We are expecting realtime detections in our application.

Thank you in advance.

@yuweiw
@Fiona.Chen
@yingliu

Are you using RTSP source?

Yes we are using RTSP source which is 25 FPS.

What is the IDR interval of your RTSP source?

The IDR Frame interval is 50.

Is the latency you mentioned the latency of receiving the first frame from the RTSP server?
If so, you may use some network tool to measure the latency of the RTSP data reach to RTSP client. E.G. Home (wireshark.org)

We compared the HLS output with the live streaming in VLC. When compared to VLC, our HLS streaming is 25 secs behind. And also the segment files generation is very slow, we have set only 3 seconds duration for each segment, but the generation speed is very slow.

Please measure the GPU loading and CPU loading during your app(pipeline) is running.

The GPU loading can be viewed by “nvidia-smi dmon”.

I checked the GPU loading with “nvidia-smi dmon”. It showed 100% for sm%.
Then for testing, I removed all the inference plugins and started the pipeline.
I connected the pipeline in the following way:
nvurisrcbin -> streammux -> demux -> queue -> nvvideoconvert -> capsfilter -> nvvl2h264enc -> h264parse -> queue -> mpegtsmux -> queue -> hlssink

Even without much GPU loading, the latency is 25secs. Is this coming from source element or from HLS part? How to achieve real-time HLS streaming? Please help us in this.

Thank you in advance.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

Can you replace the nvurisrcbin with “rtspsrc + parser + decoder” so that you can control the parameters?

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