Skip to content

GStreamer python bindings

Install

sudo apt-get install gstreamer1.0-tools gstreamer1.0-python3 

Simple usage

import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GLib

# Initialize GStreamer
Gst.init(None)

# Create a GStreamer pipeline
PIPELINE = "videotestsrc ! videoconvert ! autovideosink"
pipeline = Gst.parse_launch()

# Start playing the video
pipeline.set_state(Gst.State.PLAYING)

# Creates a main loop to keep the program running.
loop = GLib.MainLoop()
try:
    loop.run()
except KeyboardInterrupt:
    pass