Delay when I using RTSP camera

rtsp stream. even if I minimize the fps of the rtsp, the problem will be same.
Also, when I disable the probe, the delay gone

What do you mean? What is the minimal fps of your rtsp?

The probe function is a blocking callback, it will hold the whole pipeline, so the processing inside probe function should be as fast as possible.

I put fps of rtsp = 6

What is the latency of the display?

I tried to measure NVDS_ENABLE_LATENCY_MEASUREMENT=1 but nothing measured

Please refer to DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums

The delay is caused by the post-processing. You need to optimize the implementation to make it faster.

Is there a python code to measure latency?
Could I put The post-processing on the thread? If yes, how I can do it with deepstream?

No.

Yes. But if the processing time is not fast enough it will delay the video too.

Thanks.
Another question: How I can make deepstream drop frames?

If you are using nvv4l2decoder to decode h264 or h265 stream in your pipeline, you can set “drop-frame-interval” property Gst-nvvideo4linux2 — DeepStream 5.1 Release documentation

The nvinfer plugin support skip frames(not drop). Gst-nvinfer — DeepStream 5.1 Release documentation

If I am using rtsp stream?

Did you mean using interval property? Can I use it on SGIE?

Then please use rtspsrc pipeline so that you can set nvv4l2decoder properties.

Yes. It is “Interval”. I do not suggest you to use it with SGIE if it is a classifier.

what should I change on deepstream_test2 app?

If the following pipeline can work with your sources, you can modify deepstream-test2-app according to it.

gst-launch-1.0 rtspsrc location=rtsp://… ! rtph264depay ! nvv4l2decoder ! nvvideoconvert ! nvegltransform ! nveglglessink

when I run
python deepstream_test_2.py location=rtsp://admin:ccis2010@192.168.1.103:554/Streaming/channels/401
it give me this error

Error: gst-resource-error-quark: Resource not found. (3): gstrtspsrc.c(7460): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:file-source:
No valid RTSP URL was provided

and when I run
python deepstream_test_2.py rtsp://admin:ccis2010@192.168.1.103:554/Streaming/channels/401

Error: gst-stream-error-quark: Internal data stream error. (1): gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:file-source/GstUDPSrc:udpsrc0:
streaming stopped, reason not-linked (-1)

Are you familiar with Gstreamer? Please run gst-launch tool to test the pipeline.

deepstream_test_2.py does not support rtsp yet. You need to modify the code according to the gst-launch pipeline.

I run this and work fine but in python no

You need to modify the code according to the gst-launch pipeline. Or you can refer to deepstream-test3 for it can support rtsp stream.

Is it support drop-frame-interval? if not how I can add it?

Just replace uridecodebin with rtspsrc+rtph264depay+nvv4l2decoder.

Are you familiar with Gstreamer?