Why gst_element_factory_find can't find factory "decodebin"?

2.1k Views Asked by At

I have installed gstreamer-1.4.0 in order to create simple app for decoding video files. The pipeline which I try to create looks simple:

filesrc location="file.h264" ! decodebin ! filesink location="file.raw"

This pipeline works fine when i launch it using gst-launch-1.0, however when I try to run my program written in C, it cannot find factory called "decodebin".

GstElementFactory *factory;
factory = gst_element_factory_find("decodebin");
if( !factory )
    // fail

Above code always fails (factory is NULL). gst-inspect-1.0 recognizes "decodebin" correctly, so my guess is that something's wrong with GST_PLUGIN_PATH or something similar, but I have no idea how should I configure it properly. But it's just my guess based on the fact that my app creates other elements from factories such as filesrc or filesink which are in plugin called coreelements, and still decodebin which is from plugin 'playback' failes.

My question: How can i fix my gstreamer configuration in order to recognize all plugins, not just coreelements?

If i skipped some important info please let me know so that I could append it asap :)

// EDIT: Let's say i've installed gstreamer from sources (i'm using ubuntu 14.04). I've also installed all plugins (base, bag, good), also from sources. Installation directory was /opt/gstreamer-1.4.0/, maybe this causes some problem.

If I execute command:

echo $GST_PLUGINS_PATH

all I get is an empty line, similar effect when i try to display values of other GST_* environmental variables.

more specific question: Which directories should I append to which variables in order to make non coreelements plugins work?

And if this question is too general, than:

how gst_element_factory_find("factory_name") checks if a given factory exists?

1

There are 1 best solutions below

0
On

Don't know if what i did fixed everything, but for now i solved my problem by copying libplayback.so and other compiled plugins binaries to the folder with libcoreelements.so

It appears that the problem was caused by the non-standard installation directories, so my solution is a hotfix, since I still don't know how was it possible that gst-inspect-1.0 recognized all plugins whilst gst_element_factory_find() couldn't. Any further inside will be appreciated :)