Embedding scripting language in a filter element
Michael Grüner
michael.gruner at ridgerun.com
Wed Feb 5 21:37:37 PST 2014
The core won't handle python elements by itself. The trick is that there is a python plugin that works as a python element loader that will do the job.
It didn't work out of the box for me, here's what I did:
1) Check if it isn't working already
~# gst-inspect python
No such element or plugin 'python'
2) Inspect the library explicitely to see what the problem may be. I bet you already have this lib installed, if not, I'm pretty sure it comes in python-gst
~# gst-inspect /usr/lib/gstreamer-0.10/libgstpython.so
ImportError: No module named pygtk
3) Extend python path with the missing pygtk module location. This may vary in your system.
~# export PYTHONPATH=/usr/lib/python2.7/dist-packages/
~# gst-inspect /usr/lib/gstreamer-0.10/libgstpython.so
Plugin Details:
Name: python
Description: loader for plugins written in python
Filename: /usr/lib/gstreamer-0.10/libgstpython.so
Version: 0.10.22
License: LGPL
Source module: gst-python
Source release date: 2011-10-29
Binary package: GStreamer Python Bindings
Origin URL: http://gstreamer.freedesktop.org
0 features:
4) The plugin will likely continue to appear as unexistent because it has been blacklisted on the registry. Force registry regeneration.
~# gst-inspect python
No such element or plugin 'python'
~# rm ~/.gstreamer-0.10/*
~# gst-inspect python
Plugin Details:
Name: python
Description: loader for plugins written in python
Filename: /usr/lib/gstreamer-0.10/libgstpython.so
Version: 0.10.22
License: LGPL
Source module: gst-python
Source release date: 2011-10-29
Binary package: GStreamer Python Bindings
Origin URL: http://gstreamer.freedesktop.org
0 features:
5) Now you may develop your element in python. There are a few examples online. Store them under /urs/lib/gstreamer-0.10/python/ and they should appear on the inspect. I don't know if this is supported yet on the 1.0 version.
Michael
-----Original Message-----
From: Josh Doe <josh at joshdoe.com>
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Sent: Wed, 05 Feb 2014 11:03
Subject: Re: Embedding scripting language in a filter element
On Wed, Feb 5, 2014 at 9:53 AM, Michael Grüner
<michael.gruner at ridgerun.com> wrote:
> Yes, plugins written in python behave like any other. You can inspect them,
> use them with gst-launch or within your app.
It's very hard to come up with information about using Python with
GStreamer 1.0. This has some good info:
https://wiki.ubuntu.com/Novacut/GStreamer1.0
I could only come up with a single example of an element by searching
for "Gst.Element.register":
http://bazaar.launchpad.net/~jderose/+junk/gst-examples/view/head:/plugin-1.0
This asks exactly my question, but has no answer:
http://stackoverflow.com/q/17969041/403491
So as I understand it I install PyGObject
(http://sourceforge.net/projects/pygobjectwin32/), create my plugin as
in the example above, but then what? Where do I put the py/pyc/pyo
file? I can't find anything in GStreamer core about loading Python
plugins, so there must be another plugin that then searches for and
registers them.
Thanks for any help you can provide.
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140205/56d2b974/attachment.html>
More information about the gstreamer-devel
mailing list