Opencv Mat as source to DeepStream

How to give opencv matrix as a source to deepstream instead of RTSP or file?

Possible solution is to hook OpenCV with asppsrc. You may look at the sample:


It supports I420, NV12, RGBA by default and runs like:

appsrc ! video/x-raw,format=I420(or NV12, RGBA) ! nvvideoconvert ! ...

For OpenCV, it should be customized into

appsrc ! video/x-raw,format=BGR ! videoconvert ! video/x-raw,format=RGBA ! nvvideoconvert ! ...