简体   繁体   中英

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?)

Greetings

I think I've found the best solution for my given setup (st 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM