This page gives information about building QtGStreamer on Windows systems.
Getting the requirements
Visual studio 2008
The easiest way to compile everything on windows is VS 2008. The ossbuild project provides good project files for building GStreamer with VS 2008 and also Nokia provides compiled Qt binaries for VS 2008, so these two can save you quite some time. You are free of course to use another version of VS or even Mingw, but keep in mind that:
- All C++ libraries (Qt and QtGStreamer) must be compiled with the same compiler.
- GStreamer will not compile with a different version of VS, so you need either VS 2008 or Mingw for compiling GStreamer.
- MSVC generates smaller binaries than GCC.
GStreamer
The easiest way to get GStreamer working on windows is to use ossbuild. At the moment of writing, the binaries provided by the ossbuild project are a bit old for QtGStreamer, so you should compile them yourself.
Building GStreamer with ossbuild
- Install svn and clone the repository:
> svn checkout http://ossbuild.googlecode.com/svn/trunk/ ossbuild
(or use some GUI equivalent tool)
Make sure that the path where you have checked out does not contain spaces in its path. They usually cause trouble.
- If you are using the professional edition of VS, open the GStreamer.sln file from the ossbuild directory. If you are using the express edition of VS, open "GStreamer (Express).sln".
- Configure your build type from the toolbar and select to build the project.
Qt
Get the latest release of Qt from here. You can get the pre-compiled binaries for VS 2008, which will save you from a loooong compilation. Install in the default path that the installer prompts you (C:/Qt/4.x.y).
Boost
Get the latest version of boost from here. Once you download the tarball, just extract it somewhere (again, make sure there are no spaces in the path). There is no need to build boost, since only the header-only libraries are used.
Bison/Flex
Ossbuild comes with the cygwin versions of bison and flex, but unfortunately they cannot work outside the cygwin environment, so you cannot use those. Instead, get the GnuWin32 versions from here. Once you download them, install them somewhere (again, make sure there are no spaces in the path).
CMake
You can get windows binaries of cmake from here. Download the installer and install in the default location.
Automoc
Automoc is a small C++ binary that depends on Qt. Get the code from here. You can either clone it with git or download a generated tarball from anongit.kde.org.
Building automoc
In the following instructions I will assume that you have placed the sources in C:\automoc
Go to Start -> Programs -> Qt by Nokia and launch the "Qt command prompt" from there.
- Once in the prompt, cd to the automoc directory:
> C: > cd \automoc
- Create a build directory:
> mkdir build
- Create the directory where you wish to install automoc too:
> mkdir install
- Cd to the build directory:
> cd build
- Make sure cmake is in the PATH environment variable:
> set PATH=%PATH%;C:\Program Files\cmake\bin
- Configure with cmake:
> cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX="C:/automoc/install" ..
- Build:
> cmake --build .
- Install:
> cmake --build . --target install
Building QtGStreamer
The procedure is quite similar to the procedure for automoc. We will assume the following in this example:
- qt-gstreamer sources are in C:\qt-gstreamer
- automoc is installed in C:\automoc\install
- ossbuild is in C:\ossbuild
- this implies that GStreamer is installed in:
- C:\ossbuild\Build\Windows\Win32\Release
- and that GStreamer's dependencies are in:
- C:\ossbuild\Shared\Build\Windows\Win32
- this implies that GStreamer is installed in:
- boost was extracted in C:\boost_1_45_0
- CMake is installed in C:\Program Files\cmake
bison and flex are installed in C:\GnuWin32
So, the procedure is as follows:
Go to Start -> Programs -> Qt by Nokia and launch the "Qt command prompt" from there.
- Once in the prompt, cd to the qt-gstreamer directory:
> C: > cd \qt-gstreamer
- Create a build directory:
> mkdir build
- Create the directory where you wish to install qt-gstreamer too:
> mkdir install
- Cd to the build directory:
> cd build
- Make sure cmake, bison and flex are in PATH
> set PATH=%PATH%;C:\Program Files\cmake\bin;C:\GnuWin32\bin
- Configure with cmake:
> cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX="C:/qt-gstreamer/install" ^ -DBOOST_ROOT="C:/boost_1_45_0" -DCMAKE_INCLUDE_PATH="C:/ossbuild/Shared/MSVC/Include" ^ -DCMAKE_PREFIX_PATH="C:/ossbuild/Build/Windows/Win32/Release;C:/ossbuild/Shared/Build/Windows/Win32;C:/automoc/install" ..
- Build:
> cmake --build .
- Install:
> cmake --build . --target install
Running tests/examples
Compile QtGStreamer with tests and examples
QtGStreamer by default is compiled with examples but not with tests. If you also want to try the tests, you need to add an extra switch to cmake: -DQTGSTREAMER_TESTS=ON, so the configuration command becomes:
> cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX="C:/qt-gstreamer/install" ^ -DBOOST_ROOT="C:/boost_1_45_0" -DCMAKE_INCLUDE_PATH="C:/ossbuild/Shared/MSVC/Include" ^ -DQTGSTREAMER_TESTS=ON ^ -DCMAKE_PREFIX_PATH="C:/ossbuild/Build/Windows/Win32/Release;C:/ossbuild/Shared/Build/Windows/Win32;C:/automoc/install" ..
Run tests/examples
After compilation, all the tests are in build\tests\auto\Debug or build\tests\auto\Release, depending on your build type, and the examples are in build\examples\Debug or build\examples\Release.
Requirements
Add the path to the QtGStreamer, GStreamer and GLib dlls to the windows PATH enviroment variable.
Add the path to the GStreamer plugins to the GST_PLUGIN_PATH enviroment variable.
- From the desktop, right-click My Computer and click Properties.
- In the System Properties window, click on the Advanced tab.
- In the Advanced section, click the Environment Variables button.
- In the Environment Variables window click New button and set as name GST_PLUGIN_PATH and value the path to the GStreamer plugins directory (C:\ossbuild\Build\Windows\Win32\Release\bin\plugins)
- Finally, in the Environment Variables window, highlight the PATH variable in the Systems Variable section and click the Edit button. Add the path to the QtGStreamer bin directory (c:\qt-gstreamer\install\bin), to the GStreamer bin directory (C:\ossbuild\Build\Windows\Win32\Release\bin) and to the GStreamer dependencies bin directory (C:\ossbuild\Shared\Build\Windows\Win32\Release\bin). (Each different directory is separated with a semicolon)
Now you can run the examples and tests from the windows explorer.

