Last active
February 16, 2017 18:26
-
-
Save markwingerd/a95d9f49161eb78af969 to your computer and use it in GitHub Desktop.
GStreamer Tutorial 3: Part 4/4 - Streams and splits multimedia using Playbin2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 audio sink. | |
media_source.set_property('audio-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