pipeline doesn't work on python but works in linux terminal

Tim Müller tim at centricular.com
Tue Sep 22 15:30:20 PDT 2015


On Tue, 2015-09-22 at 14:28 -0700, Vladimir90 wrote:

Hi,

> I tried this pipeline gst-launch-1.0 filesrc
> location=/home/sami/Desktop/python/celine.mp4 ! decodebin ! theoraenc
> quality=1 ! oggmux ! filesink location=/home/sami/Desktop/new.ogg
> 
> and it worked and everything was ok.
> 
> But when i coded it on Python (code is gonna follow): i had the error
> message saying "element 2 could not be linked" someone can help ?

(snip code)

That's because decodebin has so-called "sometimes pads" (dynamic pads)
which don't exist yet before the pipeline starts up but are only added
later. You have to handle those pads via the "pad-added" signal when
the pop up, and then link them in the callback. gst-launch-1.0 does
that automagically for you.

You can create the pipeline via Gst.parse_launch() from the pipeline
string to get the same kind of magic gst-launch-1.0 does.

Cheers
 -Tim


-- 
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference: 8-9 October 2015 in Dublin, Ireland





More information about the gstreamer-devel mailing list