# Appsink doesn't work in Gstreamer pipeline with python

**URL:** <https://forums.developer.nvidia.com/t/appsink-doesnt-work-in-gstreamer-pipeline-with-python/185989>\
**Category:** Jetson Nano\
**Tags:** gstreamer, python\
**Created:** [August 9, 2021, 5:15am UTC](https://forums.developer.nvidia.com/t/appsink-doesnt-work-in-gstreamer-pipeline-with-python/185989 "2021-08-09T05:15:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joseespiriki](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/joseespiriki/32/115847_2.png) [@joseespiriki](https://forums.developer.nvidia.com/u/joseespiriki)\
**Post date:** [August 9, 2021, 5:15am UTC](https://forums.developer.nvidia.com/t/appsink-doesnt-work-in-gstreamer-pipeline-with-python/185989/1 "2021-08-09T05:15:23Z")

</div>

Hello all!

How can I make make the gstreamer plugin appsink work with a pipeline using Python?

The attached code is supposed to stream the camera image over UDP to a given IP address. That codes works **IF** the line 98 (**pipeline.add(appsink)**) is removed. And by work I mean: I can receive the images on the host using the following gst pipeline:

`gst-launch-1.0.exe -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink`

However the callback that was defined is not called (i.e. I can’t see the “new sample” prints on the console)

As soon as the appsink element is added to the pipeline (uncommenting line 98), the program runs fine (no gst errors) but I don’t receive any images on the host side  
It looks like adding the appsink to the pipeline stalls the whole pipeline, but no errors are show

Any input will be greatly appreciated!

Thanks!

[simple\_camera.py](https://forums.developer.nvidia.com/uploads/short-url/itDuOXYeKpineFWewZXG3lrOD09.py) (3.4 KB)

---

<div class="post-metadata">

**Author:** ![kayccc](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kayccc/32/14043_2.png) [@kayccc](https://forums.developer.nvidia.com/u/kayccc)\
**Post date:** [August 18, 2021, 5:15am UTC](https://forums.developer.nvidia.com/t/appsink-doesnt-work-in-gstreamer-pipeline-with-python/185989/4 "2021-08-18T05:15:52Z")

</div>

Sorry for the late response, we will investigate this issue to do the update soon.

---

<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:** [August 18, 2021, 6:16am UTC](https://forums.developer.nvidia.com/t/appsink-doesnt-work-in-gstreamer-pipeline-with-python/185989/5 "2021-08-18T06:16:58Z")

</div>

Hi,  
We only have experience to use _appsink_ in C programming. For using it in python, would need other users to share experience.

If you know how to do it, please also share to us so that we can learn from your experience. Thanks.

---

<div class="post-metadata">

**Author:** ![joseespiriki](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/joseespiriki/32/115847_2.png) [@joseespiriki](https://forums.developer.nvidia.com/u/joseespiriki)\
**Post date:** [August 18, 2021, 8:52pm UTC](https://forums.developer.nvidia.com/t/appsink-doesnt-work-in-gstreamer-pipeline-with-python/185989/6 "2021-08-18T20:52:28Z")

</div>

Thank you! Do you think that this could be an issue with the gstreamer library itself? I can send an e-mail to their mailing list asking about that  
I know this works with C, but I wanted to do the same thing in Python

---

<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:** [August 23, 2021, 10:39am UTC](https://forums.developer.nvidia.com/t/appsink-doesnt-work-in-gstreamer-pipeline-with-python/185989/7 "2021-08-23T10:39:21Z")

</div>

Hi,  
It may work with _numpy_. Please refer to this sample:  
[gst-appsink-opencv.py · GitHub](https://gist.github.com/cbenhagen/76b24573fa63e7492fb6)

---

<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 15, 2021, 3:20am UTC](https://forums.developer.nvidia.com/t/appsink-doesnt-work-in-gstreamer-pipeline-with-python/185989/9 "2021-10-15T03:20:06Z")

</div>

Closed on October 15, 2021, 3:20am UTC


