OpenCv Mat to GstBuffer -> appsrc, possible buffer underflow?

borisRobson brandon.robsonclarke at paxton.co.uk
Mon Feb 13 14:21:40 UTC 2017


I can't stand when people don't post their solutions, didn't even realise I
forgot to!

I create two arrays initialised to 0 : 
        offset = new gsize[4] {0};
	stride = new gint[4] {0};

Then later when creating the buffer:
	GstVideoMeta *outmeta = new GstVideoMeta();

	ostrm->stride[0] = conv.cols * inBpp;
	outmeta = gst_buffer_add_video_meta_full(outbuf,GST_VIDEO_FRAME_FLAG_NONE,
GST_VIDEO_FORMAT_RGB, conv.cols, conv.rows, 1, ostrm->offset, ostrm->stride
);

Set the stride value to image width * bytes per plane.

More info on stride:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa473780(v=vs.85).aspx

Hope this helps someone eventually




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/OpenCv-Mat-to-GstBuffer-appsrc-possible-buffer-underflow-tp4681701p4681868.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list