Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

gstreamer-1-0 not found on Mac



  • Hi,

    Disclaimer: this project runs fine on linux... the problem happens on mac only.

    I have installed all libs with brew:

    $ brew list |grep gst
    gst-libav
    gst-plugins-bad
    gst-plugins-base
    gst-plugins-good
    gst-plugins-ugly
    gstreamer
    

    my project file:

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    SOURCES += \
        main.cpp \
        mainwindow.cpp
    
    HEADERS += \
        mainwindow.h
    
    CONFIG += link_pkgconfig
    
    PKGCONFIG += gstreamer-1.0 \
            glib-2.0 \
            gobject-2.0 \
            gio-2.0
    
    unix: LIBS += -L/usr/lib/i386-linux-gnu/ -lgstvideo-1.0
    unix: INCLUDEPATH += \
        /usr/include/gstreamer-1.0 \
        /usr/include/glib-2.0/ \
        /usr/lib/x86_64-linux-gnu/glib-2.0/include/
    
    mac: LIBS += -L /usr/local/Cellar/gstreamer/1.16.2/lib -lgstvideo-1.0
    mac: INCLUDEPATH += \
        /usr/local/Cellar/gstreamer/1.16.2/include/gstreamer-1.0 \
        /usr/local/Cellar/gst-plugins-base/1.16.2/include/gstreamer-1.0 \
        /usr/local/Cellar/glib/2.64.0/include/glib-2.0
    
    FORMS += \
        mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    

    The problem happens when I try to compile & run that this error shows on the compile output:

    Project ERROR: gstreamer-1.0 development package not found
    

    The weird thing is that pkg-config finds gstreamer when I run it manually on bash:

    $ pkg-config --cflags gstreamer-1.0
    -I/usr/local/Cellar/libffi/3.2.1/lib/libffi-3.2.1/include -I/usr/local/Cellar/gstreamer/1.16.2/include/gstreamer-1.0 -I/usr/local/Cellar/glib/2.64.0/include -I/usr/local/Cellar/glib/2.64.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.64.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.44/include
    

    Any help appreciated!


  • Qt Champions 2019

    @mb79 I'm not a MacOS expert, but I don't think Qt uses GStreamer on MacOS.



  • @jsulm Thanks. You are right, it does not use it by default, but regardless of that I can use gstreamer pipelines with Qt, as one would do with any other external library.



  • Found the solution for my case.
    Just add the following to the .pro file:

    mac {
        PKG_CONFIG = /usr/local/bin/pkg-config
    }
    

    I would suggest to have this coming by default or better documented. Maybe it's me that missed it somewhere, but it should be more straighforward.


Log in to reply