This is the code to open VideoCapture
cv::VideoCapture camera("v4l2src device=/dev/video0 \ ! video/x-raw, format=UYVY, width=2592, height=1944, framerate=28/1 \ ! nvvidconv ! video/x-raw(memory:NVMM), format=I420 \ ! nvvidconv ! video/x-raw, format=GRAY8 ! appsink", cv::CAP_GSTREAMER);
We can get the video frame by
cv::Mat frame; camera.read(frame);
which will result a time cost due to a memory copy from CPU memory used by gstreamer to frame especial for large size image.
Is there any method to share the frame data memory between VideoCapture read frame and the gstreamer CPU memory?
If yes, is there any sample code available?