I installed GStreamer 1.22.10 on macOS (Sonoma) using the official binaries. I realized that gst-python is not automatically installed, so I cloned the GStreamer Gitlab repository and followed the related instructions in the gst-python subproject to install it.
I'm using Python (3.12) installed via homebrew, so I gave its pygi overrides directory to meson during setup:
meson setup builddir -Dpygi-overrides-dir=/opt/homebrew/lib/python3.12/site-packages/gi/overrides
Pygobject3 is also installed via brew in the path: /opt/homebrew/Cellar/pygobject3/3.46.0_1
Now when I do python -c "import gi; gi.require_version('Gst', '1.0');",
I get an error that the namespace Gst is not available.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/homebrew/lib/python3.12/site-packages/gi/__init__.py", line 126, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gst not available
Any help is appreciated.
Note: If GStreamer is installed using brew, gst-python is included but that is not my preferred approach because the brew version does not contain some of the packages I need, like webrtc.
I'm having the same problem.
To my understanding the gst-python is only an extension to the regular GStreamer Python bindings and adds some pythonic "syntactic sugar". So it is not really a requirement to create GStreamer applications in Python.
The error
Namespace Gst not availablemeans that it can't find the gobject-introspection information required to dynamically create the regular Python bindings for GStreamer in the first place.This information is usually stored in *.typelib files (e.g.
Gst-1.0.typelib).Those files seem to be missing when installing the latest GStreamer for MacOS using the official binaries.
However when I install GStreamer through Homebrew they are installed properly:
and
python -c "import gi; gi.require_version('Gst', '1.0');"works.But sadly the Homebrew installation seems broken for me (MacOS 14.3.1, GStreamer 1.22.10).