Unable to build gstreamer using Meson on Windows

I just ran meson setup buildDir in a clean gstreamer clone and got an error in meson-log.txt

--- stderr ---
Traceback (most recent call last):
  File "mesonbuild\mesonmain.py", line 193, in run
  File "mesonbuild\mesonmain.py", line 148, in run_runpython_command
  File "<frozen runpy>", line 287, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Dev\Projects\gstreamer\subprojects\glib-2.82.4\tools/grab-gio-dll-paths.py", line 68, in <module>
    main()
    ~~~~^^
  File "D:\Dev\Projects\gstreamer\subprojects\glib-2.82.4\tools/grab-gio-dll-paths.py", line 33, in main
    raise ValueError("%s is not a valid build path" % build_path)
ValueError: D:\Dev\Projects\gstreamer\buildDir\subprojects\glib-2.82.4 is not a valid build path



subprojects\glib-2.82.4\girepository\introspection\meson.build:35:26: ERROR: Command `"C:\Program Files\Meson\meson.exe" runpython D:\Dev\Projects\gstreamer\subprojects\glib-2.82.4\tools/grab-gio-dll-paths.py --build-path=D:\Dev\Projects\gstreamer\buildDir\subprojects\glib-2.82.4` failed with status 2.

I have no problem building it on Linux or Android though.

2 Likes

Bump, has anyone been able to resolve this?

No expert here. I haven’t been able to fully build gstreamer with meson myself if I want gst-python built. (See Error: libvpx build failed · Issue #1655 · wingtk/gvsbuild · GitHub)

Have you tried installing meson with pip yet? pip install meson

1 Like

I meant to attach this link:

Again, no expert here by any means, but at
Getting Meson
there is this line:

Please note that this is a new feature, so bug reports are expected and welcome!
1 Like

Oh right, did not notice that. Unfortunately, after removing Meson installed via MSI and reinstalling via pip, the same issue occurs.

Side note, that error is getting thrown by glib/introspection. I tried compiling only the gstreamer-sharp subproject and got another error (see below), but also related to introspection. Perhaps it’s more of a global issue with this module?

subprojects\\gtk-sharp\\Source\\tests\\generator\\regress\\meson.build:64:20: ERROR: Dependency ‘gobject-introspection-1.0’ tool variable ‘g_ir_scanner’ contains erroneous value: ‘C:/Program\\ Files/gstreamer/1.0/msvc_x86_64/bin/g-ir-scanner’

This is a distributor issue – please report it to your gobject-introspection-1.0 provider.

The file this error is referencing also does not seem to exist? Even though I chose the “complete” gstreamer installation

Years ago, when I first started trying to build gstreamer, I always got stuck when it came to gobject-introspection. I finally found gvsbuild. I don’t remember how I stumbled on it, but I’ve found it to be easier to build than using the gstreamer directions. It also uses meson.

I still want to be able to build it from the gstreamer instructions, and I think I finally have it. I need to have gst-python, and that needs gobject-introspection, so you may want to try using Dintrospection=enabled in your setup. Something like:

meson setup -Dintrospection=enabled build_dir

I thought you were trying to build this from source?

Okay, got it working:

  1. If you read the grab-gio-dll-paths.py script on line 33 it wants the glib path to have a subfolder meson-uninstalled, but since it does not exist, just create it manually
  2. If you already have gstreamer installed anywhere else, remove it’s environment variables
  3. pip install setuptools if you do not have them yet
  4. meson now prepares project correctly

When running ninja remember to run it in MSVC console OR add MSVC vars manually by running the vcvarsall.bat file located in C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build

Right now I am just running into some weird issues with linking against gstreamer built by me. Specifically, I either get an error when creating an element ( gst_element_factory_create returns false) or a very weird GLib error (something about assert is_g_object failed)

1 Like