# UDP-Raw Stream Issue On Nvidia Jetson Devices

**URL:** <https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014>\
**Category:** Jetson TX2\
**Tags:** gstreamer\
**Created:** [October 14, 2020, 7:44am UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014 "2020-10-14T07:44:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![metto](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@metto](https://forums.developer.nvidia.com/u/metto)\
**Post date:** [October 14, 2020, 7:44am UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014/1 "2020-10-14T07:44:24Z")

</div>

Hello fellow developers,  
we are working on a camera system which dishes out ~ 120Mbits/s raw data as UDP/RTP stream. We have connected the camera system and receiving devices P2P with a single ethernet cable. When we try to pick up that stream from a regular device(laptop or desktop) the video is flawless. But as we try to receive the stream from a Jetson device, the video suffers heavily from interlacing especially when there are moving objects.  
Example image:

![UDP-RAW-cropped](https://global.discourse-cdn.com/nvidia/original/3X/1/a/1a126c278eb40aad5e87845f82bd5e6b3eafb16c.png)

In all cases we have used the base Gstreamer pipeline below to recieve the stream:

```bash
gst-launch-1.0 -v udpsrc uri=udp://192.168.1.103:5555 caps="application/x-rtp, 
media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, 
sampling=(string)YCbCr-4:2:2, depth=(string)8, width=(string)1920, height=(string)1080"  
! rtpvrawdepay ! queue ! videoconvert ! xvimagesink

```

We have confirmed that the issue only appears when Jetson devices try to handle RAW data. By streaming laptop camera to Jetson, first RAW then JPEG encoded, we have observed the same issue on RAW stream but not on JPEG encoded one.  
Laptop Camera Stream Recieved On Jetson TX2:

- RAW ~ 36 Mbits/s → Interlacing
- JPEG encoded ~ 12 Mbits/s → No Interlacing

Laptop Camera Stream Recieved On Jetson Nano:

- RAW ~ 36 Mbits/s → Interlacing
- JPEG encoded ~ 12 Mbits/s → No Interlacing

Laptop Camera Stream Recieved On Desktop PC:

- RAW ~ 36 Mbits/s → No Interlacing
- JPEG encoded ~ 12 Mbits/s → No Interlacing

We have also experimented with gstreamer plugins such as `rtpjitterbuffer`, `deinterlace` and tried changing frame format(YCbCr-4:2:2, YCbCr-4:2:0, RGBA, RGB) on streaming device. But no avail. Our suspicion is that the gstreamer plugin `rtpvrawdepay` does not function correctly on Jetson devices. Which causes some udp/rtp packets to be dropped or misordered.  
Could you please assist ?  
Setup:

- **Jetson TX2**
- **Jetpack 4.4**
- **Gstreamer 1.14.5**

* * *

- **Jetson Nano**
- **Jetpack 4.4**
- **Gstreamer 1.14.5**

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [October 15, 2020, 5:48am UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014/3 "2020-10-15T05:48:48Z")

</div>

Hi,  
Please execute _sudo nvpmodel -m 0_ and _sudo jetson\_clocks_. It is the mode with max performance. You may refer to detail in document:  
[https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fpower\_management\_tx2\_32.html%23](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fpower_management_tx2_32.html%23)

And you may try to encode into h264 stream. There is an example:

> [@GStreamer issue on TX2](https://forums.developer.nvidia.com/t/gstreamer-issue-on-tx2/56048/2):
>
> Hi Bogan123, On r28.1/TX2, we are able to run [Server] $ gst-launch-1.0 videotestsrc ! nvvidconv ! omxh264enc ! 'video/x-h264,stream-format=byte-stream' ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=5000 [Client] $ export DISPLAY=:0 $ gst-launch-1.0 udpsrc port=5000 ! 'application/x-rtp,encoding-name=H264,payload=96' ! tee name=t t. ! queue ! filesink location= test.mpg t. ! queue ! rtph264depay ! h264parse ! omxh264dec ! nveglglessink Please check if it helps your case. You may …

We are deprecating omx plugins. IF you would like to try, please use _nvv4l2h264enc_ and _nvv4l2decoder_ instead of _omxh264enc_ and _omxh264dec_.

---

<div class="post-metadata">

**Author:** ![metto](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@metto](https://forums.developer.nvidia.com/u/metto)\
**Post date:** [October 15, 2020, 6:42am UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014/4 "2020-10-15T06:42:35Z")

</div>

Hi DaneLLL,  
in all of our tests the devices were in max performance mode( nvpmodel -m 0 ). We have also concluded that jetson clocks has no effect on our situation. Issue still persists.  
Working with raw data is one of our limitations so encoding with h264 is not an option at the moment. It also shouldn’t be necessary since our bandwith need is well within bandwith limits. Jetson boards offer a bandwidth of 1Gbits/s and our data is a mere 120Mbits/s. It even occurs when streaming from laptop camera to jetson (36Mbit/s). I am really struggling to find out what is causing this distortion while receiving the raw video.  
To reproduce issue with a laptop camera and peer2peer connection:

`Laptop side`

```bash
gst-launch-1.0 -v v4l2src ! video/x-raw, width=1280, height=720 ! rtpvrawpay ! udpsink host=192.168.1.103 port=5005

```

`Jetson side`

```bash
gst-launch-1.0 -v udpsrc uri=udp://192.168.1.103:5005 caps= "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:2, depth=(string)8, width=(string)1280, height=(string)720" ! rtpvrawdepay ! videoconvert ! xvimagesink

```

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [October 16, 2020, 1:00am UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014/5 "2020-10-16T01:00:18Z")

</div>

Hi,  
Setting _sync=0_ might help. Please try

```auto
... ! xvimagesink sync=0

```

---

<div class="post-metadata">

**Author:** ![metto](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@metto](https://forums.developer.nvidia.com/u/metto)\
**Post date:** [October 16, 2020, 8:35am UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014/6 "2020-10-16T08:35:39Z")

</div>

Hello again Dane,  
we have experimented with several properties from following elements:

- `xvimagesink` → `sync`, `async`, `max-lateness`
- `videoconvert` → `primaries-mode`, ‘dither’
- `deinterlace ` → `mode`, `method`, `tff`, `locking`
- `interlace` → `field-pattern`
- `udpsrc` → `blocksize`, `num-buffers`, `buffer-size`, `caps` (sampling,depth)
- `rtpjitterbuffer` → `latency`, `drop-on-latency`, `mode`

nothing above has solved our case. We have also tested that when we use Jetson devices as streamer and our laptop as receiver there are no problems. So Jetson devices can stream RAW but cannot receive RAW stream correctly?

Test conditions;

- Devices: Jetson Nano 4GB developerkit Jetpack 4.4, Jetson TX2 Developerkit Jetpack 4.4, Dell G3 p75f Ubuntu 18.04
- Connection: Peer 2 peer using single ethernet cable (Jetson IP → 192.168.1.103 , Laptop Ubuntu 18.04 IP → 192.168.1.104)
- Performance Mode: Jetson-Clocks enabled, Max Performance Mode (MAXN)
- Gstreamer Version: 1.14.5 (same on both devices)
- Cameras: Onboard Webcam, CSI Raspberry camera (Jetson)
- Format: UDP/RTP , Raw

Results:

- Jetson to Laptop → No issues on video
- Laptop to Jetson → Line by line tearing on video horizontally

Could you please try to reproduce the issue Dane?

---

<div class="post-metadata">

**Author:** ![metto](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@metto](https://forums.developer.nvidia.com/u/metto)\
**Post date:** [October 21, 2020, 11:02am UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014/7 "2020-10-21T11:02:25Z")

</div>

Hİ @DaneLLL  
We are still struggling with the same issue here. How are the results on your end? Did you manage to reproduce the issue? Is there anything more I can provide for this issue to be tested? Please let me know. Thank you for your time.

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [October 21, 2020, 1:02pm UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014/8 "2020-10-21T13:02:44Z")

</div>

Hi,  
Sending raw data in UDP streaming requires high CPU usage and network bandwidth. This may hit system limitation. Since there is hardware encoder/decoder in TX2, we would suggest compress the data into h264/h265 stream. This looks to be a more reliable usecase.

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 6:16pm UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014/10 "2021-10-18T18:16:39Z")

</div>



---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [August 30, 2023, 9:32pm UTC](https://forums.developer.nvidia.com/t/udp-raw-stream-issue-on-nvidia-jetson-devices/157014/11 "2023-08-30T21:32:53Z")

</div>

For anyone reaching out there for the same, you may also try increasing kernel recv socket buffer max size such as in [Raw data video not stable by gstreamer rtpvrawpay - #8 by Honey\_Patouceul](https://forums.developer.nvidia.com/t/raw-data-video-not-stable-by-gstreamer-rtpvrawpay/264836/8)
