Hi
I am trying to encode a full HD UYVY video stream from an nvv4l2camerasrc with the nvv4l2h265enc on a AGX Orin and then stream it to another AGX Orin via an udp sink. There the stream is decoded again using nvv4l2decoder and output in an nvdrmvideosink. This basically works well and I get the desired 60 fps with very low network utilization. Nevertheless, I have a distorted image on my display about every 5 seconds. I have an iframe interval of 300 which would result in exactly the 5 seconds (60 fps). If I make the iframe interval of the encoder smaller, the event becomes more frequent.
This is the Gstreamer pipeline that I use:
Sender:
gst-launch-1.0 -v nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM), format=(string)UYVY,framerate=(fraction)60/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)NV12, framerate=(fraction)60/1' ! queue max-size-buffers=3 leaky=downstream ! nvv4l2h265enc maxperf-enable=1 bitrate=500000000 iframeinterval=300 vbv-size=33333 insert-sps-pps=true control-rate=constant_bitrate profile=Main num-B-Frames=0 ratecontrol-enable=true preset-level=UltraFastPreset EnableTwopassCBR=false ! queue ! h265parse ! rtph265pay ! udpsink host=10.42.0.189 port=5005
Receiver:
gst-launch-1.0 -v udpsrc port=5005 ! 'application/x-rtp, payload=(int)96' ! rtph265depay ! h265parse ! queue ! nvv4l2decoder enable-max-performance=1 ! queue ! nvdrmvideosink plane_id=0
I have also tested the whole thing on the AGX Orin where I have connected the v4l2 source and output the stream directly to an autovideosink. Then there are no problems, so I assume it can’t be the source:
gst-launch-1.0 -v nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM), format=(string)UYVY,framerate=(fraction)60/1' ! nvvidconv ! autovideosink
The problem also exists if I omit the nvv4l2decoder in the pipeline and save the stream directly in an mkv file (on the AGX Orin to which the v4l2 source is connected):
gst-launch-1.0 -v nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM), format=(string)UYVY,framerate=(fraction)60/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)NV12, framerate=(fraction)60/1' ! queue max-size-buffers=3 leaky=downstream ! nvv4l2h265enc maxperf-enable=1 bitrate=500000000 iframeinterval=300 vbv-size=33333 insert-sps-pps=true control-rate=constant_bitrate profile=Main num-B-Frames=0 ratecontrol-enable=true preset-level=UltraFastPreset EnableTwopassCBR=false ! queue ! h265parse ! queue ! matroskamux name=mux ! filesink location=h265Streamer_iframe_problem.mkv
The disturbance of the picture only occurs in the lower two thirds of the picture. It is also noticeable that the interference is stronger with a complex input stream. If you have an input stream in which a large area of the image displays the same color, for example, the interference is less severe.
I therefore assume that it must be due to the nvv4l2h265enc and its settings. However, I can’t find out what the problem might be. Help would be very welcome. Also general suggestions to improve my pipeline would be greatly appreciated.
I have attached the saved video streams in this post. One stream was recorded with an iframeinterval of 300 and the other with an iframeinterval of 60.
There you can clearly see what the problem is.
h265Stream_problem_iframe.zip (25.5 MB)