Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save markwingerd/9bb7d2cc0669fe1a410a to your computer and use it in GitHub Desktop.
Save markwingerd/9bb7d2cc0669fe1a410a to your computer and use it in GitHub Desktop.
GStreamer Tutorial 2: Part 2/3 - Streams multimedia using Playbin2
# Add elements to our bin
output_bin.add(decode, convert, solarize, video_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, solarize, video_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