python3-gst

Rating: 
5
Your rating: None Average: 5 (4 votes)

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 )

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:
e539f4af9e8c7bb9b0b6267179fde215082621a874f28cd7d15f4b49adde8d8e gstreamer1.0-plugins-python-1.18.5-3.aarch64.rpm
78b590d2ac5956ff68a9bbfca31798f90bd7a767dcb186e6fce49011a2306530 python-gst-1.18.5-3.aarch64.rpm
c9d4e80e597ea41d483e411b57b357f95aaae13de5d07adb2993e766084908d2 gstreamer1.0-plugins-python-1.20.4-2.armv7hl.rpm
94c289adef724ac903f76d8f2671d639066b5bba7d4b94b6207fef044dfcca42 python-gst-1.20.4-2.armv7hl.rpm

Screenshots: 

Category:

Application versions: 
AttachmentSizeDate
File gstreamer1.0-plugins-python-1.18.5-3.aarch64.rpm35.23 KB21/08/2022 - 16:28
File gstreamer1.0-plugins-python-1.20.3-3.armv7hl.rpm13.78 KB30/07/2022 - 23:09
File gstreamer1.0-plugins-python-1.20.4-2.armv7hl.rpm13.79 KB16/10/2022 - 18:16
File python-gst-1.18.5-3.aarch64.rpm111.57 KB21/08/2022 - 16:28
File python-gst-1.20.3-3.armv7hl.rpm74.18 KB31/07/2022 - 13:18
File python-gst-1.20.4-2.armv7hl.rpm77.37 KB16/10/2022 - 18:16
Changelog: 

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))