Tik0 Tik0 - 3 months ago 65
C++ Question

Write gstreamer source with opencv

My goal is, to write a GigEVision to Gstreamer application.
The first approach was to read the frames via a GigEVision API and then send it via gstreamer as raw RTP/UDP stream.
This stream can then be received by any gstreamer application.
Here is a minimal example for a webcam: https://github.com/tik0/mat2gstreamer

The drawback of this is, alot of serialization and deserialization when the package is send via UDP to the next application.

So the question: Is it possible to write a gstreamer source pad easily with opencv, to overcome the drawbacks? (Or do you have any other suggestions?)



I think I've found the best solution for my given setup (s.t. the data is exchanged between applications on the same PC). Just using the plugin for shared memory allows data exchange with minimal effort. So my OpenCV pileline looks like:

appsrc ! shmsink socket-path=/tmp/foo sync=true wait-for-connection=false

And any other receiver (in this case gstreamer-1.0) looks like:

gst-launch-1.0 shmsrc socket-path=/tmp/foo ! video/x-raw, format=BGR ,width=<myWidth>,height=<myHeight>,framerate=<myFps> ! videoconvert ! autovideosink

Works very nice even with multiple access.