Dynamic Pipelines

Tim Müller tim at centricular.com
Mon Apr 12 18:37:59 UTC 2021

On Mon, 2021-04-12 at 15:15 +0000, Jon Lovewell wrote:

Hi Jon,
> I am looking at adding branches to a running pipeline dynamically and
> have run into a problem.
>   (snip)
> When the pipeline transitions to the playing state I add a timeout
> handler with a 2 second delay to add a branch to the ‘tee’ to display
> the video, the branch looks like this
> “queue ! videoconvert ! capsfilter caps={caps} ! autovideosink”
> Where caps are "video/x-raw, format=NV12, height=240, width=320,
> framerate=30/1"
> The branch is added, linked and synched successfully.  I can see that
> all the elements transition to the playing state except for the video
> sink which only transitions to ‘ready’ and the pipeline transitions
> to paused.  
> If I swap out ‘autovideosink’ for ‘fakesink’ the same thing happens.

Do you have a small self-contained test case that demonstrates the
problem by any chance?

Something to double-check: you write "added, linked, and synched" in
that order, but when you add elements to an already-running pipeline
you really want to do things in this order:

 - add new elements

 - set/sync state (so elements/pads are active before someone tries to
push data into them)

 - link element to the tee (now that the elements the data flows into
are in a non-NULL state).

You can check the GST_DEBUG=*:6 log to see if you find any log lines
about streaming stopping with flow flushing - if you see that, that's
probably an indication that it tried to push data on an element still
in NULL state and then the pipeline will stop silently.


More information about the gstreamer-devel mailing list