Improve gstreamer pipeline

Hi everyone,
I am doing a project with the jetson tx2 and gstreamer and I have some problems with sending video in 1080. The video has micro-cuts and freezes every X seconds.
The pipeline that I currently have is the following:

rtspsrc location="..." latency=0 ! application/x-rtp,encoding-name="H265",payload=96 ! queue max-size-bytes=0 ! rtph265depay ! video/x-h265, stream-format=byte-stream,framerate=25/1 ! h265parse ! queue max-size-bytes=0 ! nvv4l2decoder enable-max-performance=true disable-dpb=1 ! queue max-size-bytes=0 ! nvvidconv output-buffers=5 name=myconv ! video/x-raw(memory:NVMM), format=RGBA ! nvvidconv output-buffers=5 ! video/x-raw(memory:NVMM), format=NV12 ! queue max-size-bytes=0 ! nvv4l2vp9enc maxperf-enable=true bitrate=2000000 ! video/x-vp9 ! queue max-size-bytes=0 ! rtpvp9pay ! udpsink host=224.0.0.1 port=5000 max-lateness=500 sync=false qos=false auto-multicast=true

I have been trying to change some parameters of the pipeline but I can’t improve the result. Does anyone know something that makes me improve the quality of the video?

Thanks in advance.

Hi,
you may break down the pipeline to see if the issue is in decoding or encoding. Please try

gst-launch-1.0 rtspsrc location="..." latency=0 ! application/x-rtp,encoding-name="H265",payload=96 ! queue max-size-bytes=0 ! rtph265depay ! video/x-h265, stream-format=byte-stream,framerate=25/1 ! h265parse ! queue max-size-bytes=0 ! nvv4l2decoder enable-max-performance=true disable-dpb=1 ! nvoverlaysink sync=false

And see if video playback is smooth. Certain h264 stream is not suitable with disable-dpb=1. As comparison, you may also try

gst-launch-1.0 rtspsrc location="..." latency=0 ! application/x-rtp,encoding-name="H265",payload=96 ! queue max-size-bytes=0 ! rtph265depay ! video/x-h265, stream-format=byte-stream,framerate=25/1 ! h265parse ! queue max-size-bytes=0 ! nvv4l2decoder enable-max-performance=true ! nvoverlaysink sync=false

After trying, I see the same result, so I understand that the error is in the decoding, right?

Hi,
Looks like the issue is in the source. You may try the pipeline without queue and h265parse:

gst-launch-1.0 rtspsrc location="..." latency=0 ! application/x-rtp,encoding-name="H265",payload=96 ! rtph265depay ! video/x-h265, stream-format=byte-stream,framerate=25/1 ! nvv4l2decoder enable-max-performance=true ! nvoverlaysink sync=false

Same result, I can see more or less that every second the image freezes.
The frozen frame is constant

Hi,
Probably network is unstable and the RTSP packets are dropped periodically. Please try smaller resolution such as 640x480. Do you have other devices which can decode the source correctly?

Hi,
In 1280x720 I see that less happens and on other PCwith VLC on the same network as the jetson I see the strem perfectly in 1080

Hi,
It might help to keep the buffering. Please not set latency to have default 2000ms.

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

Hi,
I’ve got same results removing the latency in the pipeline.

Just a few things to try:

  • Increase recv socket max buffer size:
sysctl -w net.core.rmem_max=26214400
  • Turn Denver cores off (see this topic)

  • Replace nvv4l2decoder by h265parse ! omxh265dec:

gst-launch-1.0 rtspsrc location="..." latency=300 ! application/x-rtp,encoding-name="H265",payload=96 ! rtph265depay ! video/x-h265, stream-format=byte-stream,framerate=25/1 ! h265parse ! omxh265dec ! nvoverlaysink sync=false
1 Like