Why compiled and installed gstreamer plugin from boilerplate code is not found by gst-inspect
Asked Answered
B

4

6

I followed the instructions in GStreamer Plugin Writer's Guide (1.7.1.1):

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/index.html

in order to build a new gstreamer plugin. Basically I ran make_element and then edited Makefile.am as described. Amazingly make and make install worked and I ended up with:

/usr/local/lib/gstreamer-1.0/libgstframe_grabber.la

/usr/local/lib/gstreamer-1.0/libgstframe_grabber.so

As I understand it, gst-inspect should find this plugin automatically. The guide says that /usr/local/lib/gstreamer-1.0 needs to be added to GST_PLUGIN_PATH in order for plugins in this directory to be found. Another document states that this directory is searched automatically. I tried with and without the environment variable, but no luck.

Now I should say that I have just started to use gstreamer and I am suffering from total information overload. I have read so many documents, yet I don't even know whether I am building a gstreamer1.0 or a gstreamer0.10 plugin (I think the guide is for gstreamer1.0, since the guide's version is 1.7.1.1 but can't be sure).

Can anybody give me a clue here ?

Blain answered 8/2, 2016 at 2:1 Comment(0)
C
7

There are many possible reasons that can cause this issue.
First, check if your plugin is blacklisted by command gst-inspect-1.0 -b. If your plugin show up here, that means it is really blacklisted.
In that case, delete directory ~/.cache/ and then run gst-inpect-1.0 again. This will force GStreamer to re-scan plugins list. If the reason of blacklist is not solved yet, gst-inpect will probably print out the reason here for you.

Another possible reason (but unlikely happens) is setting GST_REGISTRY_UPDATE as no, which will force GStreamer NOT to rescan the plugin directory, thus not found new plugin

P/s: The guide is for GStreamer 1.0

Capsaicin answered 24/2, 2016 at 16:59 Comment(1)
clearing ~/.cache worked for me. Thank youBeaut
M
4

If you've tried removing your plugin from the blacklist and it still doesn't show up, try this:

export GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0

/usr/local/lib/gstreamer-1.0 is the default directory used by make in case of plugins. If you have defined a different directory, use it.

Then run gst-inspect-1.0 and you'll find the newly compiled and installed plugin.

You'll be required to perform the export every time in the shell whether you either create a static pipeline with gst-launch-1.0 or run code of your own. I couldn't find any alternative to make it permanent other than making entry of this in .bashrc file. If you have one, please suggest via comments.

Marianomaribel answered 14/2, 2018 at 4:56 Comment(1)
in my case, I am using CentOS 7 and the directory should be gstreamer-0.10 gst-inspect-1.0 --version gst-inspect-1.0 version 1.10.4 GStreamer 1.10.4 redhat.com --------------------------- gst-inspect --version gst-inspect-0.10 version 0.10.36 GStreamer 0.10.36 download.fedora.redhat.com/fedoraAriana
L
1

If you run ./configure --help in the gst-plugin directory you will see the following:

By default, make install' will install all the files in /usr/local/bin', /usr/local/lib' etc. You can specify an installation prefix other than/usr/local' using --prefix', for instance--prefix=$HOME'.

If you do after the original installation:sudo updatedb && locate libgst[NAME_OF_YOUR_PLUGIN].so you should see where the library holding your plugin is located (in my case it is under /usr/local/lib/gstreamer-1.0/ as described by the configure help above).

Now on my machine, the GStreamer "official" plugins are installed under: /usr/lib/i386-linux-gnu/gstreamer-1.0/ . This is where the new created plugin library should be stored.

To store the plugin at the right place, run configure with the following parameter:

./configure --libdir=/usr/lib/i386-linux-gnu followed by make && sudo make install

It is important to override with --libdir and NOT --prefix! The usage of --prefix will stick a /lib that we don't want to have under /usr/lib/i386-linux-gnu.The plugin will not be found by gst-inspect-1.0 if /lib is added to the path.

Extra note : Even if the plugin is at the proper location, you may still see GStreamer blacklisting it when you run gst-inspect-1.0. One of the cause of the blacklisting could be the shared library/ies required by your plugin not installed or not found on your platform. The ldd command can help figuring out the dependencies your plugin may have. Just run ldd [YOUR_GSTREAMER_LIBRARY].so

Libenson answered 12/2, 2019 at 22:39 Comment(0)
R
1

For anybody else having this issue. As mentioned there can be multiple causes. My troubleshooting process for gstreamer-plugins is as follows:

  1. Check if all dependencies, that are required by your plugin can be found. On Linux you can use 'ldd'. For windows there is either dumpbin.exe or Dependencies.exe
  2. Make sure your GST_PLUGIN_PATH is set correctly and does not include any other libraries, only gstreamer plugins This is a weird issue. As gstreamer will scan all library files found in the GST_PLGUIN_PATH. This sometimes can lead to crashes and errors. At the very least it will slow down you gstreamer initialization step.
  3. Check if your plugiin library file is named the same as you register it in code, with the call to gst_element_register(). Sometimes platforms append a debug suffix to the library name. Or sometimes the developer just messes something up with the naming of the created library.
Raleighraley answered 20/3, 2023 at 14:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.