Important: Please read the Qt Code of Conduct -

Building Qt-GStreamer

  • Hello,

    I have spent a few days resolving problems with qt-GStreamer and so I thought I would share my work so others might be able to benefit.

    This is more of a guide of how I built it but also leaves some questions that I don't know the answer to.

    GStreamer can grab many different sources of video and so is very useful as a plugin for
    use in Qt.

    I am using Qt 5.7.1 with GStreamer 1.10.2 (32-bit-developer)

    Download the qt-gstreamer Git Repository from here:

    You will need to have Git ( installed on your machine. I
    also use the nice GUI from Attlasian – Source Tree:

    Once you have qt-gstreamer downloaded to a directory, you will ned a lot of things
    installed in order to build it.

    You will need to install CMake from here:

    You obviously will need GStreamer. Qt-GStreamer didn’t like the 64bit version of
    GStreamer, so I would stick with the 32bit version (x86):

    You also need to install Boost from here:

    And also the Glib / GObject from GTK+
    This wasn’t so straight forward because there isn’t an installer from You have to
    download MSYS2 installer from here:
    Then you have to run a few commands with MSYS2 to install everything. These are all the
    commands that I run that got it to work.
    pacman -Sy pacman
    pacman –Syu (keep running this until it says there is nothing left to update)
    pacman -S mingw-w64-x86_64-toolchain
    The last command installs the toolchain – don’t ask me what that is. There is more
    information here:

    Now you should be ready to build qt-gstreamer!
    Open up a command line and cd to the qt-gstreamer directory.
    Now run:
    $ mkdir build && cd build
    $ cmake .. -G "Visual Studio 12 2013" -DCMAKE_INSTALL_PREFIX=\DEV
    \GStreamer\qt-gstreamer -DQT_VERSION=5 -Wno-dev

    This tells CMake to use QT Version 5 and to suppress the CMake warnings for developers
    and to use Visual Studio 2013 Cmake generator.
    If everything works then you should get a list of all the dependencies that you do have and
    a list of some things built by CMake. If it doesn’t work then you will get a list of missing
    Requirements on the command line and also in the build directory in a file called
    Requirements. If this happens, then install the missing requirements and delete everything
    in the build directory before trying again.

    Now you should have a full build directory. Open up the QtGStreamer.sln file in Visual
    Studio 2013 and choose Release Mode and then choose Build->Build Solution. This will
    build a lot of things. I still got a few build failures but it was usable enough for me.
    I wanted to run the QMLPlayer2 example, so I went straight to this solution:
    and opened the qtgst-example-qmlplayer2.sln

    Now you can build that in release mode and you will have the executable in this directory:

    Run: QT_DIR\bin\Windeployqt.exe to pull in all the dependencies.
    $ cd QT_DIR\bin
    $ windeployqt.exe C:\DEV\qt-gstreamer\build\examples\qmlplayer2\Release

    This should fill up your qmlplayer2\Release folder with all the dll files and folders required
    to deploy the qmlplayer on another machine.

    For some reason this didn’t pull in all the dependencies for me and I had to manually add
    these folders:
    Also requires the QtGStreamer folder from
    Requires Qt5OpenGL.dll file from QT_DIR\bin\Qt5openGL.dll
    GStreamer also requires this file in this directory but I don’t know where this comes from:

    It is probably an extra installation option with GStreamer.

    If everything works then you should see a cartoon about a bunny start playing.

    Other notes: When I first ran this on my machine I got a green screen instead of the
    video. This turned out to be my Intel graphics card wasn’t good enough for it. Luckily I had
    another graphics card already installed on my machine I just wasn’t using it x-(

    Hope this helps somebody. Please contribute any further information.


  • Moderators

    @MichaelR I don't have need of this, but wanted to say thank you for the write up and sharing. :)

  • Lifetime Qt Champion


    You should maybe consider converting this to a Wiki article, forum posts don't stay visible in the long run.

  • Hi Michael.

    Are you getting success working with pipelines in you Qt GStreamer code?

    If yes, could you take a look in a question I asked today about third part tools, please?

    Any hint will be very helpful!

    Best regards.


  • Thanks for sharing your guide. I don't know why I'm having a hard time building this on Windows 10. I ran:

    cmake .. -G "Visual Studio 14 2015" -DCMAKE_INSTALL_PREFIX=\Programs\GStreamer\qt-gstreamer -DQT_VERSION=5 -Wno-dev -DCMAKE_PREFIX_PATH=C:/Qt/5.11.0/msvc2015

    which succeeded until

    -- Could NOT find GObject (missing: GOBJECT_INCLUDE_DIR GOBJECT_LIBRARIES)
    -- The following REQUIRED packages could NOT be located on your system.
    -- You must install these packages before continuing.
       * GLib  <>
         Required to build QtGLib
       * GObject  <>
         Required to build QtGLib

    I used MSYS2 to install GTK+ in C:\Programs\gtk\gtk-3.19 but I might not have the necessary environment variables or paths that must be defined. I don't know if they were supposed to be created during installation or if I'm supposed to create or define them.

    The file C:\Programs\qt-gstreamer\cmake\modules\FindGLIB2.cmake contains

    find_path(GLIB2_MAIN_INCLUDE_DIR glib.h
              PATH_SUFFIXES glib-2.0

    so to the environment variable "PKG_CONFIG_PATH" I added "C:\Programs\gtk\gtk-3.19\include" because glib.h is in "C:\Programs\gtk\gtk-3.19\include\glib-2.0".

    Something I found that doesn't seem right is what is in C:\Programs\gtk\gtk-3.19\lib\pkgconfig\glib-2.0.pc which contains


    which makes this appear to be for linux, not my Windows installation.
    What seems to be more appropriate is what I found in C:\gstreamer\1.0\x86\lib\pkgconfig\glib-2.0.pc which contains


    but when I replaced the previous path with "C:\gstreamer\1.0\x86\lib\pkgconfig" in "PKG_CONFIG_PATH", this didn't change the symptoms.

    If you could let me know what I might be missing that would let cmake know where to find GLib/GObject, I'd appreciate it.

  • Hi Jward,
    I can't remember having problems with this specifically.
    Only thing I could suggest if you have installed GLib and GObject is to manually define environment variables for GLIB2_LIBRARIES, GLIB2_MAIN_INCLUDE_DIR, GOBJECT_INCLUDE_DIR and GOBJECT_LIBRARIES.

  • Thanks Michael. None of the variables you listed are in my environment. If they are in yours, where do they point? If you don't have them, they shouldn't be needed for cmake to be able to build the project but I'm obviously missing something .

  • @jward I had rebuild this plugin today and had the same problem. I found that I had to include the GStreamer bin dir in my environment path.
    I added this to my path and cmake configured correctly:

Log in to reply