Last active
August 29, 2015 14:10
-
-
Save markwingerd/46237b789b782baefc40 to your computer and use it in GitHub Desktop.
GStreamer Tutorial 3: Part 2/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
# Add elements to our bin | |
output_bin.add(decode, convert, tee, audio_queue, audio_sink, wavescope_queue, | |
wavescope_visual, wavescope_convert, wavescope_sink, file_queue, | |
file_encode, file_sink) | |
# Link decodebin with autoconvert when its source pad has been created. | |
decode.connect('new-decoded-pad', on_new_decoded_pad) | |
# Callback function to link decodebin to autoconvert. | |
def on_new_decoded_pad(dbin, pad, islast): | |
decode = pad.get_parent() | |
pipeline = decode.get_parent() | |
convert = pipeline.get_by_name('convert') | |
decode.link(convert) | |
print 'linked!' | |
# Link the rest of our elements together. | |
if (not gst.element_link_many(convert, tee) or | |
not gst.element_link_many(audio_queue, audio_sink) or | |
not gst.element_link_many(wavescope_queue, wavescope_visual, | |
wavescope_convert, wavescope_sink) or | |
not gst.element_link_many(file_queue, file_encode, file_sink)): | |
print 'Not all elements could link.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment