sej
September 25, 2020, 2:10pm
1
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.
DaneLLL
September 28, 2020, 1:48am
3
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
sej
September 28, 2020, 8:06am
4
After trying, I see the same result, so I understand that the error is in the decoding, right?
DaneLLL
September 28, 2020, 9:16am
5
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
sej
September 28, 2020, 3:15pm
6
Same result, I can see more or less that every second the image freezes.
The frozen frame is constant
DaneLLL
September 29, 2020, 3:32am
7
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?
sej
September 29, 2020, 1:59pm
8
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
DaneLLL
September 30, 2020, 1:01am
9
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
sej
September 30, 2020, 10:50am
10
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
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