This module contains a wrapper that allows GStreamer applications to be
written in Python.
If you want to use multimedia in your python app on a Sailfish device, you'll need this module.
And if you want to use qml in a noarch app and miss some gstreamer options in Qt Multimedia, you'll need this module too (e.g. Equalizer or Set speed/pitch on audio/raw streams).
python-gstreamer ( Python3.8 --- gstreamer1.0 ) gst-python python-gst (*-2.50*.rpm)
python-gstreamer ( Python3.11 --- gstreamer1.0 ) gst-python python-gst (*-2.51*.rpm)
provides: libgstpython.so
using in your .py code file:
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GLib, GObject
sha256sum filename:
0892364388409a38e7d828fd6ab6bd6657de982e10f7b79a83eb87f640ceed48 gstreamer1.0-plugins-python-1.26.11-2.51.aarch64.rpm
e9bbaad7b759b273c3e8845f23b7d26ef3e727d2abeb0568eaee0009417d02a8 gstreamer1.0-plugins-python-1.26.11-2.51.armv7hl.rpm
ba66557a042bbfa544d7a69e4006ef2326713514f745619abe5d357620b066b9 gstreamer1.0-plugins-python-1.28.5-2.50.armv7hl.rpm
8942f1f817f8112222c196ef393433fab49ac685ef073da64c5a72fbee5f6a27 python-gst-1.26.11-2.51.aarch64.rpm
91232114895bbe3b42caafa3d0985b5b85416968ab476eb733f7e36caa7fdda4 python-gst-1.26.11-2.51.armv7hl.rpm
0f5e3bb6ce6ab723334e82e59db97a8380f8df1a0a543b0f7a90a8541d7ee8e1 python-gst-1.28.5-2.50.armv7hl.rpm
helloworld.py example:
#!/usr/bin/env python
import sys
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst, GLib
def bus_call(bus, message, loop):
t = message.type
if t == Gst.MessageType.EOS:
sys.stdout.write("End-of-stream\n")
loop.quit()
elif t == Gst.MessageType.ERROR:
err, debug = message.parse_error()
sys.stderr.write("Error: %s: %s\n" % (err, debug))
loop.quit()
return True
def main(args):
if len(args) != 2:
sys.stderr.write("usage: %s <media file or uri>\n" % args[0])
sys.exit(1)
Gst.init(None)
playbin = Gst.ElementFactory.make("playbin", None)
if not playbin:
sys.stderr.write("'playbin' gstreamer plugin missing\n")
sys.exit(1)
# take the commandline argument and ensure that it is a uri
if Gst.uri_is_valid(args[1]):
uri = args[1]
else:
uri = Gst.filename_to_uri(args[1])
playbin.set_property('uri', uri)
# create and event loop and feed gstreamer bus mesages to it
loop = GLib.MainLoop()
bus = playbin.get_bus()
bus.add_signal_watch()
bus.connect ("message", bus_call, loop)
# Create element to add (echo)/equalizer-10bands to the signal
gecho = Gst.ElementFactory.make('audioecho')
gecho.set_property('delay', 500000000)
gecho.set_property('intensity', 0.6)
gecho.set_property('feedback', 0.4)
gequa = Gst.ElementFactory.make('equalizer-10bands')
gequa.set_property('band2', 3.0)
# Create playbin and add the custom audio sink to it
playbin.set_property('audio_filter', gequa)
#playbin.set_property('audio_filter', gecho)
# start play back and listed to events
playbin.set_state(Gst.State.PLAYING)
try:
loop.run()
except:
pass
# cleanup
playbin.set_state(Gst.State.NULL)
if __name__ == '__main__':
sys.exit(main(sys.argv))
Recent comments