Metrics from the latency subsystem

Nicolas Dufresne nicolas at
Fri Oct 15 01:53:09 UTC 2021

Hi Vineet,

Thanks for your question, see answers below.

Le jeu. 14 oct. 2021 19 h 15, Vineet Krishnan via gstreamer-devel <
gstreamer-devel at> a écrit :

> Hello,
> I'm looking into the Tracing subsystem
> <> to
> measure processing latency in our gstreamer pipeline. On running the
> generated file through gst-stats, I get the following output -
> Latency Statistics:
>     0x7fd35e827ce0.audiotestsrc0.src|0x7fd35c813290.rtmpsink0.sink:
> mean=0:00:00.059332305 min=0:00:00.003686000 max=0:00:00.782444000
>     0x7fd35d0082e0.videotestsrc0.src|0x7fd35c813290.rtmpsink0.sink:
> mean=0:00:00.043311752 min=0:00:00.003628000 max=0:00:00.797304000
> Element Latency Statistics:
>     0x7fd35d030190.capsfilter0.src: mean=0:00:00.000519092
> min=0:00:00.000263000 max=0:00:00.001867000
>     0x7fd35e830240.audiomixer0.src: mean=0:00:00.023331131
> min=0:00:00.001518000 max=0:00:00.774963000
>     0x7fd35e82f4d0.audioconvert0.src: mean=0:00:00.000393081
> min=0:00:00.000143000 max=0:00:00.011368000
>     0x7fd35d034150.x264enc0.src: mean=0:00:00.003406024
> min=0:00:00.002231000 max=0:00:00.006731000
>     0x7fd35e82fc70.faac0.src: mean=0:00:00.000625431 min=0:00:00.000355000
> max=0:00:00.003427000
>     0x7fd35e830540.mux.src: mean=0:00:00.036701334 min=0:00:00.000177000
> max=0:00:00.792271000
> I couldn't find a definitive explanation of these numbers by searching
> online, so I wanted to verify if my understanding is correct.
> For the line
> 0x7fd35e827ce0.audiotestsrc0.src|0x7fd35c813290.rtmpsink0.sink:
> mean=0:00:00.059332305 min=0:00:00.003686000 max=0:00:00.782444000
> Does it mean that there was a mean latency of 0.059s and a max latency of
> 0.78s to propagate a buffer from the audiotestsrc to the rtmpsink? If yes,
> would this represent the end-to-end processing latency of this source->sink
> path?

The reported latency includes all form of latency. The processing latency
is usually estimated by subtracting the reported latency. Though, in case
of tsdemux, which has over 700ms latency declared, it will only effectively
have this latency during the period needed to figure-out timestamp
information, hence the much lower mean latency.

> Similarly, for the element latency statistics -
> 0x7fd35d034150.x264enc0.src: mean=0:00:00.003406024 min=0:00:00.002231000
> max=0:00:00.006731000
> Does it mean that the x264enc is adding 0.006s processing latency?

In this case, I can only suppose you are using x264 zerolatency tuning. And
indeed, with that context this number will be purely the processing time.

> Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list