Gst_discoverer_xxx which lib

I wanted to try something with gst discoverer. But it fails at gst_discoverer_new();, which it aborts with undefined reference to 'gst_discoverer_new'.
The header gst/pbutils/gstdiscoverer.h is found.

I compiled it with the following command.

gcc -o main main.c `pkg-config --cflags --libs gstreamer-1.0 gstreamer-plugins-base-1.0`

I suspect that something is missing in pkg-config.

Does anyone have any advice?

You’ll have to use gstreamer-pbutils-1.0. The pkg-config files are always called after the underlying library in case of GStreamer.

1 Like

Thanks, that works.

 gcc -o main main.c `pkg-config --cflags --libs gstreamer-1.0 gstreamer-pbutils-1.0`

Thanks, that’s how it works.

How do you find these lib dependencies?

Check e.g. from the docs or the location of the header file in which library the API you want to use is.

1 Like

In the headers there is GST_xxx__API, do these say which lib you need?

const lib-name
GST_AUDIO_BAD_API gstreamer-bad-audio-1.0
GST_AUDIO_API gstreamer-audio-1.0
GST_VIDEO_API gstreamer-video-1.0
GST_BASE_API gstreamer-base-1.0
GST_PBUTILS_API gstreamer-pbutils-1.0

Yes, that’s another indication

1 Like