Trying to use gst / omx in python

Sebastian Dröge sebastian at centricular.com
Mon Apr 7 23:56:35 PDT 2014


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
-------------- 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-openmax/attachments/20140408/e1659262/attachment.sig>


More information about the gstreamer-openmax mailing list