How to shuttle GstMeta information between Python and C?

Arjen Veenhuizen arjen.veenhuizen at
Sun Apr 10 22:00:04 UTC 2016

I have been having great difficulty grasping the concept of GstMeta and using
it from Python. A minimal-not-working-example can be found  here
<>  .

I created a basic pipeline ([videotestsrc] - [capsfilter] - [xvimagesink[)
with a buffer probe on the capsfilter src pad. My goal is to add
GstVideoCropMeta to each passing buffer (in python). Xvimagesink already
implements a get_meta for this metadata type so that should be easy to

Unfortunately, I am unable to figure out how to actually store x, y, width
and height in the GstVideoCropMeta instance and making xvimagesink to
pick-up these values. 

In C, things look fairly  straightforward

Implying that, after doing the gst_buffer_add_video_crop_meta, I should
store the x, y, width and height directly on its return value (a Gst.Meta).
But that's doesn't really make sense right?

Setting GST_DEBUG=xvimagesink*:8, I can see that xvimagesink is picking up
the metadata, but x, y, width and height are still 0 (or worse, are
sometimes random numbers from uninitialized memory locations making things
crash and burn).

I have been reading the  docs
a dozen times but I am still a bit lost.

View this message in context:
Sent from the GStreamer-devel mailing list archive at

More information about the gstreamer-devel mailing list