input-selector sync-streams: on or off?

Nicolas Dufresne nicolas at ndufresne.ca
Wed Jun 23 19:50:13 UTC 2021


Le mercredi 23 juin 2021 à 16:00 +0200, Michiel Konstapel via gstreamer-devel a
écrit :
> I am using input-selector to switch between live video from a webrtcbin 
> and an imagefreeze (is-live=TRUE) "placeholder" source. I was wondering 
> what the proper setting is for the input-selector's sync-streams 
> property. The documentation is rather brief:
> 
> "If set to TRUE all inactive streams will be synced to the running time 
> of the active stream or to the current clock.
> 
> To make sure no buffers are dropped by input-selector that might be 
> needed when switching the active pad, sync-mode should be set to "clock" 
> and cache-buffers to TRUE."
> 
> By default this is set to TRUE, but sync-mode defaults to 
> "active-segment" and "cache-buffers" defaults to FALSE, which both do 
> not match their recommended settings.
> 
> - What does the sync-streams setting actually do?

Makes the input selector behave a bit like a sink, and hold on the buffer until
the running-time for that buffer is reached. Live sources may have different
latency, if the current selected input has lower latency, with the sync-streams
set and a queue, the buffers will be queued, and the switch won't be delayed by
the latency difference. If it's non-live input, then it will avoid bursting
through your media, causing a high CPU spike, and likely no streaming on switch
(EOS).

(In practice, it should not sync on the clock, but use the active stream
running-time as a clock for the other streams.)

> - Should I turn it on or off?

Leave it on.

> - If ON, what should the sync-mode and cache-buffers settings be?

I think using the clock is a bit bogus, I'd stick with the segment (which
basically means converting all timestamp to running-time, and comparing with the
active stream position in running-time).

> 
> Kind regards,
> Michiel
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




More information about the gstreamer-devel mailing list