QtGStreamer/BuildingOnWindows

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:

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

> 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.

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

> C:
> cd \automoc

> mkdir build

> mkdir install

> cd build

> set PATH=%PATH%;C:\Program Files\cmake\bin

> cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX="C:/automoc/install" ..

> cmake --build .

> cmake --build . --target install

Building QtGStreamer

The procedure is quite similar to the procedure for automoc. We will assume the following in this example:

So, the procedure is as follows:

> C:
> cd \qt-gstreamer

> mkdir build

> mkdir install

> cd build

> set PATH=%PATH%;C:\Program Files\cmake\bin;C:\GnuWin32\bin

> 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" ..

> cmake --build .

> 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.

Now you can run the examples and tests from the windows explorer.