# UDP source to appsink example

**URL:** <https://forums.developer.nvidia.com/t/udp-source-to-appsink-example/167950>\
**Category:** Jetson AGX Xavier\
**Tags:** gstreamer\
**Created:** [February 8, 2021, 10:33pm UTC](https://forums.developer.nvidia.com/t/udp-source-to-appsink-example/167950 "2021-02-08T22:33:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sefa\_H](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sefa_h/32/66831_2.png) [@Sefa\_H](https://forums.developer.nvidia.com/u/Sefa_H)\
**Post date:** [February 8, 2021, 10:33pm UTC](https://forums.developer.nvidia.com/t/udp-source-to-appsink-example/167950/1 "2021-02-08T22:33:51Z")

</div>

I’m streaming with:

> gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw,format=UYVY,width=640,height=480’ ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=NV12’ ! nvv4l2h264enc maxperf-enable=1 insert-sps-pps=1 ! h264parse ! rtph264pay ! udpsink host=192.xxx.xx.xx port=5000 sync=false

and able to receive with:

> gst-launch-1.0 udpsrc port=5000 ! ‘application/x-rtp,encoding-name=H264,payload=96’ ! rtph264depay ! h264parse ! nvv4l2decoder enable-max-performance=1 ! nvoverlaysink

and capture inside a Python code,

> capture = cv2.VideoCapture(“udpsrc port=5000 ! application/x-rtp, encoding-name=H264, payload=96 ! rtph264depay ! h264parse ! nvv4l2decoder enable-max-performance=1 ! autovideoconvert ! video/x-raw, format=BGR ! appsink”, cv2.CAP\_GSTREAMER)

starts, says:

> Opening in BLOCKING MODE

but does not shows anything.

For testing my Python code:

> capture = cv2.VideoCapture(“v4l2src device=/dev/video1 ! video/x-raw, width=640, height=480,format=UYVY ! videoconvert ! video/x-raw, format=BGR ! appsink”, cv2.CAP\_GSTREAMER)

works.

Could you point me a working example of UDP source to openCV appsink please

---

<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:** [February 9, 2021, 12:19am UTC](https://forums.developer.nvidia.com/t/udp-source-to-appsink-example/167950/3 "2021-02-09T00:19:01Z")

</div>

Hi,  
You may replace _autovideoconvert_ with

```auto
nvvidconv ! video/x-raw,format=BGRx ! videoconvert

```

and try again.

---

<div class="post-metadata">

**Author:** ![Sefa\_H](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sefa_h/32/66831_2.png) [@Sefa\_H](https://forums.developer.nvidia.com/u/Sefa_H)\
**Post date:** [February 9, 2021, 4:04am UTC](https://forums.developer.nvidia.com/t/udp-source-to-appsink-example/167950/4 "2021-02-09T04:04:46Z")

</div>

@DaneLLL  
It works  
Thanks you

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 18, 2021, 6:20pm UTC](https://forums.developer.nvidia.com/t/udp-source-to-appsink-example/167950/6 "2021-10-18T18:20:27Z")

</div>

Closed on October 18, 2021, 6:20pm UTC


