[gst-devel] [decodebin 0.9] getting informations of a stream

Ronald S. Bultje rbultje at ronald.bitfreak.net
Mon Aug 29 04:50:16 CEST 2005

Hi Vincent,

(our) implementation problem, let me explain:

On Mon, 2005-08-29 at 11:33 +0200, Vincent Torri wrote:
> With gstreamer 0.9, Ronald told me that setting the pipeline to PAUSED
> fill all the informations I need (size, framerate, length, etc...)

Ideally, this is the case. However, this is not implemented yet, so
you'll need a bit more.

> but when I set the pipeline to PAUSED, I only get all the new pads. To get
> the informations, I have to set the pipeline to PLAYING and I need to look
> at the "notify::caps" signal, as in gstreamer 0.8. Am I missing something,
> or is it the only way to get these informations ?

So this is done using something called 'preroll'; preroll works well,
but only if a sink is in the pipeline. With no sink, preroll "is not
needed" and thus skipped. This is nice for most purposes, but sucks for

So, you want decodebin to preroll (which means 'prepare data for the
sink in the ready->paused state transition'); you do that by attaching a
fake sink (fakesink :) ). Now, to trigger preroll, you add an unused
sink to the pipeline you're prerolling; not doing this will make the
pipeline aware of the sink too late, and thus it will still be skipped.
So you have this pipeline:

filesrc ! decodebin                 fakesink

For each new pad in decodebin, link a fakesink to it:

                    ! fakesink
filesrc ! decodebin ! fakesink      fakesink
                    ! fakesink

And then remove the unused fakesink. Now, after the ready->paused state
transition, it will be ready to process data, and data types will have
been set on the pads, just like you wanted.


More information about the gstreamer-devel mailing list