Use UDP rtsp sink in Deepstream without packet drops

Hello,

We are using Deepstream on our Orin NX connect via LAN to a host computer. We are trying to send the video via RTSP, and experience packet drops. The stream is 25FPS video 1280X720 so the packet drop does not make sense. We did see in Deepstream NVIDIA Q&A a recommendation to use TCP instead. It does fix the stream but the TCP bandwidth overhead does not work for us. What can be done to get UDP transport to work without drops?
Thanks

Hi,
It may be helpful to set up vbv-size. Please refer to
Random blockiness in the picture RTSP server-client -Jetson TX2 - #5 by DaneLLL

And add setting vbv-size to deepstream-app for a try.

You may also try this set up as comparison/reference:
Jetson AGX Orin FAQ

Thanks for your reply,
I’ve added :
g_object_set (G_OBJECT (bin->encoder), “vbv-size”, 2000000 , NULL);
in create_udpsink_bin method in the common of deepstream app. I think it has a small improvement bust still packets are dropped when there are changes in the image. Looking in wireshark the dropped packets are related to burst udp packets sent ( a few packets with 1 ms).
I’ve also tried reducing bitrate to 2000000 and increase buffers:
net.core.rmem_max
net.core.wmem_max

Hi,
Do you use rtspsrc to receive the stream? If yes, please not to set rtspsrc for a try. By default it buffers 2000ms and should be enough.

Hi, no we use a CSI camera source. I’ve updated the profile to 0 (it was 4=high) and it works much better. I see approx ~2 packet drop in a minute now. But again that’s for 2000000 bit rate. for 3000000 there are more drops so if you have any additional recommendations for improvement it would be great.
But the stream is much more stable now

Hi,
Please try to set the properties:

  EnableTwopassCBR    : Enable two pass CBR while encoding
                        flags: readable, writable, changeable only in NULL or READY state
                        Boolean. Default: false
  disable-cabac       : Set Entropy Coding Type CAVLC(TRUE) or CABAC(FALSE)
                        flags: readable, writable
                        Boolean. Default: false

Try poc-type=2:

  poc-type            : Set Picture Order Count type value
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 2 Default: 0

Or try to adjust IDR/I frame interval:

  idrinterval         : Encoding IDR Frame occurance frequency
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 256
  iframeinterval      : Encoding Intra Frame occurance frequency
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 30