Problem with NVDEC

I use Gstreamer play an IPC camera.
Command is

gst-launch-1.0 -v rtspsrc location=rtsp://admin:admin123@192.168.1.43/avstream/channel=1/stream=0.sdp ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! xvimagesink

But it has 4~5 seconds delay. And the NVDEC is worked at 128M.

When I use ffplay without NVDEC, it has 1~2 seconds delay.

ffplay rtsp://admin:admin123@192.168.1.43/avstream/channel=1/stream=0.sdp

Why?

Waiting for a reply

Hi,
Please try to set the property in rtspsrc:

  latency             : Amount of ms to buffer
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 2000

and the property in nvv4l2decoder:

  enable-max-performance: Set to enable max performance
                        flags: readable, writable
                        Boolean. Default: false

Thanks DaneLLL,

After adding these two property, the delay decreased and NVDEC worked at 857M.

But there is still a delay of 2 seconds, which is similar to the delay without using NVDEC.

Is there any other way to lower the delay?

Hi,
The delay may be from the source or network. Please try UDP and see how much latency it is for comparison.

I tested using both FFmpeg (without nvdec) and gstreamer (with nvdec) using Python code, and the delay was reduced to around 400ms. So, without considering CPU usage, the efficiency of CPU software decoding and hardware decoding is similar. Can we understand it this way?

Hi,
Please enable the property and try:

  disable-dpb         : Set to disable DPB buffer for low latency
                        flags: readable, writable
                        Boolean. Default: false

By default decoder will output frames in display order and decoded frame are queued. Please disable it and see if there is further improvement.

After enable the property, the delay has been reduced to 200ms. Thank you very much!

1 Like

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