Filling Gst.Buffer in Python

Tanel Alumäe alumae at gmail.com
Wed May 22 06:42:34 PDT 2013


Hello,

I'm trying to use Python to create a Gst.Buffer filled with some data, and
push it to a Gstreamer pipeline via appsrc. I'm using GStreamer 1.0.7 under
Debian (amd64, package name is gir1.2-gstreamer-1.0_1.0.7-1_amd64.deb),
python 2.7.

My implementation is available here:
https://gist.github.com/alumae/5627250#file-test_buffer-py

The problem is that the data that is pushed to the Gstreamer pipeline and
that is finally dumped by the filesink, is not exactly what I'm trying to
push. Namely, the actual data seems to be prepended by 36 bytes of
"garbage".

More, exactly, I'm trying to push the string:
123412341234123412341234123412341234123412341234

What is actually pushed:
<36 bytes of garbage>123412341234

It seems that the fill method is actually using the reference to the python
object, not the actual array, and the 36 bytes is just the Python object
header.

Is there some other way (perhaps via MapInfo?) to set the Gst.Buffer data
in Python?

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130522/712b092d/attachment.html>


More information about the gstreamer-devel mailing list