RTSP streaming from Jetson cant play smoothy

Hello guys,
I am trying to create one RTSP server to stream my processed frame. I have two gstreamer pipeline to make it working now:

  1. appsrc name=rtsp_src format=GST_FORMAT_TIME max-latency=0 caps=video/x-raw,format=BGR,width=1920,height=1080 ,framerate=30/1 ! videoconvert ! video/x-raw,format=(string)RGBA ! nvvidconv ! nvv4l2h265enc ! video/x-h265,stream-format=byte-stream ! rtph265pay name=pay0 pt=96
  2. appsrc name=rtsp_src format=GST_FORMAT_TIME max-latency=0 caps=video/x-raw,format=BGR,width=1920 ,height=1080,framerate=30/1 ! videoconvert ! videorate ! video/x-raw,format=I420 ! x264enc speed-preset=ultrafast tune=zerolatency ! rtph264pay name=pay0
    Seem like both working on Jetson, but the output is different.
    1 give me very good resolution RTSP, but it is not smooth, like keep freezy a bit.
    2 give me smooth RTSP but the resolution is not good.
    Can you guys help me why my first pipeline keep freezy, I think because nvenc?

In addition to what @manhnd1 said above, the problem appears to relate to NVEnc and is not limited to RTSP streams. We also ran a Gstreamer video on Ubuntu and it also showed stuttered playback. The issue occurs even when we’re not running inference and goes away when we turn NVEnc off. But without NVEnc, our RTSP stream quality is low so we do need it.

@WayneWWW @kayccc any thoughts on this? As soon as we can resolve this issue then we can ship our latest update to our customers.

Many thanks in advance

Please apply the steps to run system at maximum performance. To see if this helps the case:

  1. execute $ sudo nvpmodel -m 0 and $ sudo jetson_clocks
  2. Set the property to nvv4l2h265enc
  maxperf-enable      : Enable or Disable Max Performance mode
                        flags: readable, writable, changeable only in NULL or READY state
                        Boolean. Default: false

For comparison, may try UDP streaming:
Gstreamer TCPserversink 2-3 seconds latency - #5 by DaneLLL

Thank for your reply.
But I have set it before, could there be another cause for this?

Please try UDP and check if you observe the issue. Probably the network bandwidth is insufficient.

Hi @DaneLLL, we will give that a go. however, the problem also occurs when we’re not streaming RTSP. When we’re viewing the video on the Ubuntu desktop using Gstreamer, the video still stutters when NVEnc is enabled (with RTSP output disabled).

For a try, you may set the two properties: insert-sps-pps=1 idrinterval=15.
And can try to enable the properties:

  insert-vui          : Insert H.265 VUI(Video Usability Information) in SPS
                        flags: readable, writable
                        Boolean. Default: false
  insert-aud          : Insert H.265 Access Unit Delimiter(AUD)
                        flags: readable, writable
                        Boolean. Default: false
1 Like

Thank you for your suggestions
Seem like it improve a bit, early it still freezy but after 30seconds it play smoother

Hi, @manhnd1 :
May I to know which command can see your above information?

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