Is it still possible to have standalone Python elements in GStreamer 1.0?
Asked Answered
P

2

6

I have an application written with gst-python for GStreamer 0.10 that I am trying to port to GStreamer 1.0.

In my application, I have some custom elements written in Python (subclasses of gst.BaseSrc and gst.BaseTransform). Each python-element has its own file and is placed in /usr/lib/gstreamer-0.10/python so that gst-launch and gst-inspect can pick them up (which they do).

This is very handy, since it makes it possible for me to experiment with different pipelines directly on the command line.

Now that I am trying to port my application (according to this guide https://wiki.ubuntu.com/Novacut/GStreamer1.0) it looks like even if it is still possible to write python-elements with PyGI, it seems like the possibility to store them in separate files and have them integrated in GStreamer is gone.

All examples I have found talks about placing the elements in the program you are writing and then registering them with a call Gst.Element.register, but if I would do so, it would only be possible to reach my custom elements directly from this program and I want them to work standalone (with gst-launch) without having to write my filter chains in a program.

So does anyone know if this is still possible with GStreamer 1.0?

Patriciate answered 31/7, 2013 at 11:27 Comment(1)
And as usual when it comes to GSTreamer, only a few people has the knowledge needed to answer and those people really don't care about "simple" newbie questions. For this question and others I have tried IRC and even directly emailing people, but not a single response so far.Patriciate
P
3

In order to help other people struggling with this, I am now answering this myself.

After some deep research I have now found out that it has not been possible to have any standalone python elements before gst-python 1.4.0 was released on 2014-10-20.

For the release notes take a look here:

http://gstreamer.freedesktop.org/releases/gst-python/1.4.0.html

Patriciate answered 8/2, 2015 at 0:53 Comment(2)
Thank you very much for reporting your findings on this. It is frustrating sometimes getting help on these types of issues, so I applaud you for finding the answer and sharing with others. This really helped me.Annular
Thank you. I am glad if it helped you.Patriciate
N
0

I dont know if you have the same issue that I had, but in the example from https://wiki.ubuntu.com/Novacut/GStreamer1.0 there is a mistake that was causing an error when I tried to register a new plugin. It is using

__gstdetails__ = (
    'Dmedia File Source',
    'Source/File',
    'Resolves a dmedia ID to a file path, then acts like a filesrc',
    'Jason Gerard DeRose <[email protected]>',
)

when it has to be:

 __gstmetadata__  = (
    'Dmedia File Source',
    'Source/File',
    'Resolves a dmedia ID to a file path, then acts like a filesrc',
    'Jason Gerard DeRose <[email protected]>',
)
Nonalcoholic answered 26/3, 2014 at 9:52 Comment(1)
As you can see in my new answer it has not been possible to do this before the 1.4.0 release of gst-python. You must have written your code in such a way that your Python elements was embedded in your Python program. Having standalone Python elements that are usable from other languages is a relatively new feature for GStreamer 1.0, but has worked in previous versions for ages.Patriciate

© 2022 - 2024 — McMap. All rights reserved.