Trying to use gst / omx in python

TDAS talldarkandstrange at me.com
Tue Apr 8 07:02:25 PDT 2014


Thanks Sebastian. So my import statements now read:

   import sys, os
   import pygst, pygtk
   from gi.repository import Gst, Gtk, GObject

…(it complains if either the Gtk and GObject aren’t also taken from the gi repo). It’s now telling me that gtk isn’t defined… confused! 

On 8 Apr 2014, at 07:56, Sebastian Dröge <sebastian at centricular.com> wrote:

> On Mo, 2014-04-07 at 18:39 +0100, TDAS wrote:
>> Still a bit new to this, so hope I’m not being daft here ;) Trying to play an h.264 mp4 file in Python on a Raspberry Pi. And failing miserably ;) I’ve installed all the requirements (I believe) and I’m using the below script, which I adapted from somewhere. Now the command line works as follows:
>> 
>> gst-launch-1.0 filesrc location=/home/user/test.mp4 ! qtdemux ! queue max-size-bytes=10000000 ! h264parse ! omxh264dec ! queue max-size-buffers=4 ! eglglessink
>> [...]
>> pygst.require("0.10")
>> import gst
>> [...]
> 
> Your gst-launch line uses GStreamer 1.x, while the Python script uses
> GStreamer 0.10. GStreamer 0.10 most likely won't work properly on the
> RPi.
> 
> For GStreamer 1.x you'll have to use the PyGI based bindings, e.g. use
> instead of the above:
>> from gi.repository import Gst
> 
> Also the API has changed due to the switch to PyGI.
> 
> -- 
> Sebastian Dröge, Centricular Ltd - http://www.centricular.com
> Expertise, Straight from the Source
> _______________________________________________
> gstreamer-openmax mailing list
> gstreamer-openmax at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-openmax



More information about the gstreamer-openmax mailing list