Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save markwingerd/f9facc012af86395b019 to your computer and use it in GitHub Desktop.
Save markwingerd/f9facc012af86395b019 to your computer and use it in GitHub Desktop.
GStreamer Tutorial 2: Part 3/3 - Streams multimedia using Playbin2
# Create pads for the bin.
decode_pad = decode.get_static_pad('sink')
ghost_pad = gst.GhostPad('sink', decode_pad)
ghost_pad.set_active(True)
output_bin.add_pad(ghost_pad)
# Set media_source's video sink.
media_source.set_property('video-sink', output_bin)
# Set our pipeline state to Playing.
media_source.set_state(gst.STATE_PLAYING)
# Wait until error or EOS.
bus = media_source.get_bus()
msg = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE,
gst.MESSAGE_ERROR | gst.MESSAGE_EOS)
print msg
# Free resources.
media_source.set_state(gst.STATE_NULL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment