This document guides you through the process of building, installing, and using Qt5GStreamer on Windows.
Boost is required to build and use Qt5GStreamer. Set up is rather simple. Download the .zip from the boost.org website, extract it, and set the environment variable BOOST_ROOT to the root directory of the boost installation(C:\boost\boost_1_63_0). Verify this is correctly set up by opening a command prompt and typing
dir %BOOST_ROOT%\libs. You should see a bunch of directories.
Download and install at least the runtime and development files from the Gstreamer web site. Set both environment variables GSTREAMER_ROOT_X86 and GSTREAMER_1_0_ROOT_X86 to the installation directory(C:\gstreamer\1.0\x86). Add %GSTREAMER_ROOT_X86%\bin to your PATH. Verify you have this set up correctly by opening a command prompt and type
gst-launch-1.0 -h. You should see the usage output from the gst-launch command.
|If you choose to add cmake to your path (more convenient), make sure you add it AFTER %QTDIR%\bin. The cmake bin directory has qt .dll's that will likely cause conflicts, so I would recommend making it the last item in your path just to be safe.|
If chose to add cmake to your PATH, verify it is correctly set up by opening a command prompt and typing
cmake -version. You should see the version of cmake printed on the screen.
Using the default install path of "C:/Program Files (x86)/QtGStreamer" can cause problems because of the special characters in the path, and special permissions required, so we'll install it to C:\QtGStreamer.
git clone https://github.com/GStreamer/qt-gstreamer
Verify Qt5GStreamer is properly built and installed by opening a command prompt and typing
dir %QTGSTREAMER_ROOT%\bin. You should see some .dll files starting with Qt5G.
If you're going to use cmake, you're all set. If you want to use qmake, there are additional steps to set up.
There are several ways to set up pkg-config. Some set-ups are complicated, and some don't work :-/ Fortunately, I found a simple set up that works. Download pkg-config-lite from https://sourceforge.net/projects/pkgconfiglite/files/
Unzip, and add the bin directory to your path. Verify this is set up correctly by opening a command prompt and typing
pkg-config --help. You should see the help for pkg-config.
Set PKG_CONFIG_PATH to %GSTREAMER_ROOT_X86%\lib\pkgconfig;%QTDIR%\lib\pkgconfig;%QTGSTREAMER_ROOT%\lib\pkgconfig. Verify pkg-config can find Qt5Streamer-1.0 by opening a command prompt and typing
pkg-config --cflags Qt5GStreamer-1.0. You should not see any errors. If you see errors, you will need to resolve them. If you're using the MSVC compiler, check the MSVC section below.
Add the following to .pro file:
CONFIG += link_pkgconfig PKGCONFIG += Qt5GStreamer-1.0 Qt5GStreamerUi-1.0 QT += widgets INCLUDEPATH += $$(BOOST_ROOT)
Try opening the example .pro included with the qt-gstreamer source, make some edits, and try to build it. If you can build and run the example, you're all done.
Edit two files under %QTGSTREAMER_ROOT%\lib\pkgconfig. Qt5Glib.pc and Qt5GStreamerUi.pc: comment Qt5Core and Qt5Widgets. pkg-config can't find them because they don't exist for MSVC.
As a general rule, don't mix 32 and 64 bit, debug and release, libraries.