Jetson x265 -> rtpay -> udpsink discards SPS/PSS

Overview

I am trying to stream compressed video from a Xavier via RTP over UDP to a remote PC.
I require the stream to be h264 or h265 (since we will be using the hardware encoders), and will be transported over an isolated ethernet local network.

I am having issues with the udpsink on the xavier NX and AGX devices. It looks like it is sending an empty payload.

My questions are:

  1. Is this a known issue? If not, is it reproducible?
  2. If so, is there a workaround that doesn’t involve setting up a RTSP server?
  3. If not, what are my next steps to trying to diagnose this issue.

Problem Description

On the Host PC (Windows running Ubuntu 18.04 on WSL1, address 192.168.1.207 with all firewalls turned off, gstreamer 1.14.5 installed via apt) the following pipeline works
gst-launch-1.0 videotestsrc ! video/x-raw,width=1280,height=720,framerate=30/1,format=I420 ! x265enc speed-preset=superfast tune=zerolatency ! h265parse config-interval=1 ! rtph265pay name=pay0 pt=96 ! udpsink port=5000 host=192.168.1.207 buffer-size=1024 blocksize=512

in the sense that the following SDP

c=IN IP4 192.168.1.207
m=video 5000 RTP/AVP 96
a=rtpmap:96 H265/90000

is read by VLC, and displayed on the screen.

On either Xavier, running Jetpack 4.4 (AGX) or 4.5.1 (NX) running exactly the same pipeline
with the exactly the same SDP (except with the IP addresses changed to the corresponding devices) does not work in the sense that VLC does discover the stream but reports hevc info: Waiting for VPS/SPS/PPS.

Some Testing

Initially, i thought this was an issues with VLC. So instead I used gstreamer as the client.
In particular i used the following client pipeline
gst-launch-1.0 udpsrc port=5000 ! 'application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H265,payload=(int)96' ! rtph265depay ! h265parse ! matroskamux ! filesink location=test.mkv.

I performed the following test on different devices:

  1. On the server: run the first (udpsink) pipeline with the IP address pointed at the correct destination.
  2. On the client: run the second (file recorder) pipeline.
  3. After a couple of seconds, copy (if necessary) the file to the windows PC and play it in VLC.

The results are:

  • Server(PC) → Client(PC) works
  • Server(PC) → Client(AGX) works
  • Server(AGX) → Client (PC) fails
  • Server(AGX) → Client(AGX) fails

Additionally, running listening (with netcat) to the udp port, shows that udp packets are being transmitted, but it looks like the payload is more-or-less empty.

Finally, to make sure i didn’t have issues with payloading and parsing i ran
gst-launch-1.0 videotestsrc ! 'video/x-raw,width=1280,height=720,format=I420,framerate=30/1' ! x265enc ! h265parse config-interval=-1 ! rtph265pay pt=96 ! 'application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H265,payload=(int)96' ! rtph265depay ! h265parse ! matroskamux ! filesink location=test.mkv on the AGX, which successfully recorded videotestsrc to test.mkv and was playable in VLC.

Debug info

I’ve attached the level-3 gstreamer debug file for reference.
debug.txt (81.0 KB)

In Closing

An idea solution for us would be to get the UDP sink working. Any help with this would be much appreciated.

We’re tied to Jetpack 4.4 on the AGX due to driver dependencies.
We are already exploring alternatives using RTSP, but that introduces overhead on other parts of our software stack, and we would prefer if this was not necessary.

Many Thanks.
Pete. C

(edit: attached debug.txt)

Hi,
We have a reference setup with hardware encoder. Please take a look at
Gstreamer TCPserversink 2-3 seconds latency - #5 by DaneLLL

In receiver side it cannot guarantee to receive the stream from very beginning, so decoding begins from first complete IDR frame and needs to have SPS/PPS with IDR frames.

Thanks for the response @DaneLLL

On the Xavier AGX running gst-launch-1.0 videotestsrc is-live=1 ! video/x-raw,width=1280,height=720 ! timeoverlay valignment=4 halignment=1 ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1280 ,height=720' ! nvv4l2h264enc insert-sps-pps=1 idrinterval=15 ! h264parse ! rtph264pay ! udpsink host=10.19.106.10 port=5000 sync=0

produces the warning

WARNING: erroneous pipeline: no property "idrinterval" in element "nvv4l2h264enc0.

I assume that this is due to the Jetpack version we are using.
Of course omitting this property means that it does not work.

On the Xavier NX, running Jetpack 4.5.1, I can confirm that gst-launch-1.0 videotestsrc is-live=1 ! video/x-raw,width=1280,height=720 ! timeoverlay valignment=4 halignment=1 ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1280,height=720' ! nvv4l2h264enc insert-sps-pps=1 idrinterval=15 ! h264parse ! rtph264pay ! udpsink host=192.168.1.207 port=5000 sync=0 works both to gstreamer and VLC (using the above SDP)

H265 also works in this configuration.

Do you have any suggestions re: JetPack 4.4, as our camera provider hasn’t yet updated the drivers since 4.4.

Hi,
The source code of gst-v4l2 is public. You may try

  1. Build libgstnvvideo4linux2.so of JP4.5.1 and apply to 4.4. Please backup the prebuilt lib before replacement.
  2. If 1. does not work, please port the code of adding idrinterval from 4.5.1 to 4.4. It is to add a property and should be a simple patch.

Links to source code: https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/Sources/T186/public_sources.tbz2
https://developer.nvidia.com/embedded/l4t/r32_release_v5.1/r32_release_v5.1/sources/t186/public_sources.tbz2