Skip to content

Instantly share code, notes, and snippets.

@fthiery
Created July 4, 2018 12:27
Show Gist options
  • Save fthiery/7cf291686b9d4450ead393220f63fb8a to your computer and use it in GitHub Desktop.
Save fthiery/7cf291686b9d4450ead393220f63fb8a to your computer and use it in GitHub Desktop.
Python3 Gstreamer boilerplate
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GLib
Gst.init(None)
p = "videotestsrc is-live=true ! autovideosink"
pipeline = Gst.parse_launch(p)
GLib.idle_add(pipeline.set_state, Gst.State.PLAYING)
ml = GLib.MainLoop()
ml.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment