7c68ef354b
The `imp` module got removed in python 3.12 and the `importlib` module should be used instead. This is also a good excuse to switch to the new finder module from PEP 451 : https://www.python.org/dev/peps/pep-0451/ This only requires implement the `find_spec()` method in our custom loaders Co-authored-by: Stefan <107316-stefan6419846@users.noreply.gitlab.freedesktop.org> Co-authored-by: Jordan Petrids <jordan@centricular.com> Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5633> |
||
---|---|---|
.. | ||
examples | ||
gi | ||
old_examples | ||
plugin | ||
scripts | ||
testsuite | ||
COPYING | ||
gst-python.doap | ||
meson.build | ||
meson_options.txt | ||
NEWS | ||
README.md | ||
RELEASE |
gst-python
gst-python is an extension of the regular GStreamer Python bindings based on gobject-introspection information and PyGObject.
It provides two things:
-
"syntactic sugar" in form of overrides for various GStreamer APIs that makes them easier to use in Python and more pythonic; and
-
support for APIs that aren't available through the regular gobject-introspection based bindings, such as e.g. GStreamer's fundamental GLib types such as
Gst.Fraction
,Gst.IntRange
etc.
Prerequisites
These libraries are needed to build gst-python:
- gstreamer core
- gst-plugins-base
- pygobject
You will also need pygobject and glib installed. On debian-based distros you can install these with:
sudo apt build-dep python3-gst-1.0
Only Python 3 is supported.
Building
meson setup builddir && ninja -C builddir
meson install -C builddir
Using
Once installed in the right place, you don't need to do anything in order to use the overrides. They will be loaded automatically on
import gi
gi.require_version('Gst', '1.0')
gi.repository import GObject, Gst
Note that additional imports will be required for other GStreamer libraries to
make use of their respective APIs, e.g. GstApp
or GstVideo
.
License
gst-python is licensed under the LGPL 2.1