How to shuttle GstMeta information between Python and C?

Arjen Veenhuizen arjen.veenhuizen at
Mon Apr 11 14:34:04 UTC 2016

It turns out this is actually quite an old bug which was mentioned in  this
message on the Gstreamer list in November 2014. In short, we cannot assign
values to a GstMeta object in python and recover them in C. The reverse,
however, is possible using some tweaks.

I came up with the following work-around.

First of all, use the latest gobject introspection bindings when compiling
GStreamer from source. For this, you need to install:

Also, add --enable-introspection when running when compiling the
gstreamer packages

and make sure you install the .typelib files in the proper folder. 

You can use 

to check the location of the typelib files in use by pygi.

Based on bug  #702921 <>  
I was able to add a couple of publicly accessible methods
(gst_buffer_get_video_meta and gst_buffer_set_video_meta) to gstvideometa.c
and gstvideometa.h (gst-plugins-base) which allow me to explicitly set and
get the contents of a GstVideoCropMeta metadata instance in the C

In python you can then use:

Note, as Stian Stelnes already mentioned in the bugreport above, the
publicly accessible methods must be functions, not macros!

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

More information about the gstreamer-devel mailing list