Appsink doesn't work in Gstreamer pipeline with python

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 (3.4 KB)

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

1 Like

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.

1 Like

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

1 Like

Hi,
It may work with numpy. Please refer to this sample:
gst-appsink-opencv.py · GitHub