appsrc: minimum latency bigger than maximum latency

Tim Müller tim at centricular.com
Wed Nov 27 11:49:17 UTC 2019


On Wed, 2019-11-27 at 12:03 +0100, Milian Wolff wrote:

> Quite frankly, the documentation on that topic is quasi 
> impossible to understand for me. GstAppSrc just references latency
> but doesn't explain when one should use it and what values one should
> use. Then the overall topic on Latency just talks about the time
> between two points which is a metric I can understand - but how does
> one apply this concept to a single point (AppSrc)? If my AppSrc is
> fed with a 25Hz timer, is the max-latency then  40ms?

There's some more detailed documentation here:

https://gstreamer.freedesktop.org/documentation/additional/design/latency.html?gi-language=c

You would typically set min-latency (which is "the latency") and not
set max-latency. max-latency indicates how much internal buffering
there is.

For example: an audio source might push out data in 20ms chunks, so
would introduce 20ms latency, but might have an internal ring buffer of
10 chunks, so 200ms. Now if another branch (going into the same
audiomixer, say) advertised 500ms latency that would be a problem,
because it means the audio source branch does not have enough buffering
to accommodate the 500ms of latency/delay/wait-time caused by the other
branch's latency. To fix that you'd have to add a queue of at least
300ms after the audio source or configure the audio source to have a
larger ring buffer.

Cheers
 Tim

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



More information about the gstreamer-devel mailing list