Enigma2 plugin to to play various online streams (mostly Latvian).

basic-tutorial-1.py 661B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python3
  2. # -*- coding:utf-8 -*-
  3. # GStreamer SDK Tutorials in Python
  4. #
  5. # basic-tutorial-1
  6. #
  7. """
  8. basic-tutorial-1: Hello world!
  9. http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+2%3A+GStreamer+concepts
  10. """
  11. from gi.repository import Gst
  12. Gst.init(None)
  13. # Build the pipeline
  14. pipeline = Gst.parse_launch(
  15. "playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm")
  16. # Start playing
  17. pipeline.set_state(Gst.State.PLAYING)
  18. # Wait until error or EOS
  19. bus = pipeline.get_bus()
  20. msg = bus.timed_pop_filtered(
  21. Gst.CLOCK_TIME_NONE, Gst.MessageType.ERROR | Gst.MessageType.EOS)
  22. # Free resources
  23. pipeline.set_state(Gst.State.NULL)