Python VideoFilter Plugin. Buffer None in do_transform_frame
Sebastian Dröge
sebastian at centricular.com
Wed Jan 6 00:17:23 PST 2016
On Di, 2016-01-05 at 18:19 -0300, hrojas at lacuatro.com.ar wrote:
> Hello,
> I am trying to develop a custom video filter plugin but I am
> getting an empty buffer in VideoFrame parameter.
>
> The code is as follows:
>
> def do_transform_frame_ip(self, f):
> try:
> data = f.buffer.extract_dup(0, f.buffer.get_size())
> bgr = numpy.ndarray((1080, 1920, 3), buffer=data,
> dtype=numpy.uint8)
> print bgr.shape
> except Exception as e:
> print e
>
> return Gst.FlowReturn.OK
>
> VideoFrame metada is fine, but Buffer is None
What do you mean with metadata? The other fields of the GstVideoFrame?
Are the plane data pointers set to something useful too?
My guess would be that this is something wrong with the Python
bindings, and them not being able to handle GstBuffer typed struct
fields.
You could also try using GstBaseTransform directly instead of
GstVideoFilter if you're going to directly access the buffers directly
and not using GstVideoFrame... however from looking at your code you
should probably use more of the GstVideoFrame metadata instead. The row
stride for example.
--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160106/9261263b/attachment.sig>
More information about the gstreamer-devel
mailing list