We're hiring!
*

Building GStreamer on Windows

Aaron Boxer avatar

Aaron Boxer
November 26, 2019

Share this post:

Reading time:

Note: In September 2021, the GStreamer project merged all its git repositories into a single, unified repository, often called monorepo. The build system referred in this post as "gst-build" is now in the root of this combined/mono repository.

Given GStreamer's roots in the Linux/GTK world, Windows has seemed at times like a second-class citizen when it came to hacking GStreamer code. With the advent of meson and gst-build, however, this is no longer the case. It is now possible to set up a Windows development environment that rivals the finest Linux has to offer, with full support for Visual Studio debugging into the library.

Here's how:

Background

There are two official ways of building GStreamer on Windows - using cerbero or gst-build. As gst-build is a lot quicker, we will use this approach in this post.

Setup

We are going to use not one but two IDEs ! Vi vs EMACS people : Nothing to see here, move along.

(note on step 3: we will be running meson from source, so please skip the pip install of meson)

  1. meson
  2. pkg-config
  3. gst-build pre-requisites for Windows
  4. Visual Studio 2019 community edition
  5. Eclipse CDT (optional) (you will need to have a Java JRE/JDK installed)

pkg-config

While not frequently used on Windows, pkg-config allows us to manage GStreamer dependencies on other projects. After unzipping the binaries, put their location on your Windows PATH.

Meson

After cloning meson, create a meson.cmd file with the following contents:

@echo off

c:\\PATH\TO\CLONED\MESON\SRC\meson.py %*

and put the file location on your Windows PATH.

Git

I recommend the superb Git client Git Extensions.

Important: once Git is installed, ensure that line endings are configured to core.autocrlf in your Git configuration. Otherwise, you may get Windows line endings breaking GStreamer shell scripts.

Environment

Next, we set up a few environment variables (note the backslash at the end of the first three variables):

Environment Variable Value
SOURCE_DIR c:\\PATH\TO\YOUR\SOURCE\
GSTREAMER_1_0_ROOT_X86_64 %SOURCE_DIR%x86_64\
GST_SRC_BUILD_PATH %SOURCE_DIR%gst-build\build\subprojects\
PKG_CONFIG_PATH %GSTREAMER_1_0_ROOT_X86_64%lib\pkgconfig
GST_PLUGIN_PATH %GST_SRC_BUILD_PATH%gst-plugins-good;%GST_SRC_BUILD_PATH%gst-plugins-bad;%GST_SRC_BUILD_PATH%gst-plugins-base

Clone

Now, we will clone gst-build into our SOURCE_DIR directory, like so:

> cd %SOURCE_DIR%
> git clone https://gitlab.freedesktop.org/gstreamer/gst-build.git

And finally we add the following entry to our PATH environment variable

%GSTREAMER_1_0_ROOT_X86_64%bin

Build

  1. Open a Visual Studio x64 command prompt from the Windows start menu:
     

    Visual Studio 2019 \ x64 Native Tools Command Prompt

  2. Run meson on gst-build:
    > cd %SOURCE_DIR%gst-build
    > meson --prefix=%GSTREAMER_1_0_ROOT_X86_64% build
    

Option 1: Build with ninja from command line

  1. Run ninja to build and install gst-build
    > ninja -C build install
    

Option 2: Build GStreamer with Eclipse

  1. Launch Eclipse from the x64 command prompt:

    C:\\PATH\TO\ECLIPSE\eclipse.exe

  1. Under the Eclipse File \ Import menu, choose import C++\Existing code as Makefile Project and select the %SOURCE_DIR%gst-build folder. You now have a fully-indexed, fully searchable project containing GStreamer code for base, plugins etc. Since gst-build is a big project, and Eclipse uses a lot of resources, we can filter out the build folder from the project by:
    1. typing Alt Enter to open the project Properties
    2. Under Resource \ Resource Filters, add a filter to exclude the build folder (choose the Project Relative Path setting)

  2. Eclipse by default does not save files before building. Under Windows \ Preferences \ General \ Workspace \ Build. select Save automatically before build.

  3. Right click on the gst-build project, select Properties \ C++ Build \ Builder Settings, un-check Use default build command and enter ninja -C build install as the build command.

  4. Right click on the gst-build project, select Properties \ C++ Build \ Behaviour and delete all from the Build (incremental build) box.

  5. Press Ctrl + B to build and install GStreamer.

Hack

  1. Open your project in Visual Studio. Your compile and link settings should use the GSTREAMER_1_0_ROOT_X86_64 environment variable to ensure you are linking to the gst-build version of GStreamer.

  2. To set Visual Studio breakpoints in GStreamer, open a file from the appropriate sub-project inside GST_SRC_BUILD_PATH and set the breakpoint.

  3. To modify GStreamer code, edit the code and build in Eclipse (or your favorite editor) - your Visual Studio project will automagically pick up the changes when it next runs. Don't forget to run the ninja -C build install step.

Push

Inside GST_SRC_BUILD_PATH, the Git repositories can be modified to point to different branches. The only issue here is when executing ninja -C build update, which will stop on the modified repositories.

The only tool missing on Windows is gst-indent. To indent new code, we need to:

  1. Install Windows Subsystem for Linux (WSL), with Ubuntu 18.04

  2. Open WSL and:
      $ sudo apt install git autoconf autopoint libtool make texi2html wget
      $ mkdir src && cd src
      $ wget https://ftp.gnu.org/gnu/indent/indent-2.2.11.tar.gz
      $ tar xvzf indent-2.2.11.tar.gz
      $ cd indent-2.2.11 && ./configure
      $ make && sudo make install
    

Now we can indent new code in the Ubuntu terminal like so:

$ /mnt/c/PATH/TO/SOURCE/gst-build/subprojects/gstreamer/tools/gst-indent /mnt/c/PATH/TO/FILE.c

Finally, we take the potentially dangerous step of removing the gst-indent pre-commit hook from the GStreamer sub-project we are working on:

  > cd %SOURCE_DIR%gst-build\subprojects\SOME_GST_SUBPROJECT\.git\hooks
  > del pre-commit

We must now be careful to remember to run gst-indent from the Ubuntu terminal before committing.

Now sit back and give yourself a big high-five !

If you have any questions about GStreamer on Windows or any other platform, please contact us.

Search the newsroom

Latest Blog Posts

Re-thinking framebuffers in PanVK

23/03/2026

PanVK’s new framebuffer abstraction for Mali GPUs removes OpenGL-specific constraints, unlocking more flexible tiled rendering features…

Running Mainline Linux, U-Boot, and Mesa on Rockchip: A year in review

02/03/2026

Get the recap of Nicolas Frattaroli's FOSDEM talk detailing Rockchip’s mainline progress, including Vulkan 1.4 and NPU support as a vital…

Now streaming: Collabora XDC 2025 presentations

02/12/2025

As an active member of the freedesktop community, Collabora was busy at XDC 2025. Our graphics team delivered five talks, helped out in…

Implementing Bluetooth LE Audio & Auracast on Linux systems

24/11/2025

LE Audio introduces a modern, low-power, low-latency Bluetooth® audio architecture that overcomes the limitations of classic Bluetooth®…

Strengthening KernelCI: New architecture, storage, and integrations

17/11/2025

Collabora’s long-term leadership in KernelCI has delivered a completely revamped architecture, new tooling, stronger infrastructure, and…

Font recognition reimagined with FasterViT-2

11/11/2025

Collabora extended the AdobeVFR dataset and trained a FasterViT-2 font recognition model on millions of samples. The result is a state-of-the-art…

Open Since 2005 logo

Our website only uses a strictly necessary session cookie provided by our CMS system. To find out more please follow this link.

Collabora Limited © 2005-2026. All rights reserved. Privacy Notice. Sitemap.