Measure element latency
Nicolas Dufresne
nicolas at ndufresne.ca
Thu Jun 6 01:45:46 UTC 2019
Le mer. 5 juin 2019 17 h 55, Taoming Huang <taoming29 at gmail.com> a écrit :
> Hi,
>
> I am working a WebrRTC RTP streaming application which has a low latency
> requirements using GStreamer 1.14. I would like to calculate latency, and
> emit it as a metrics on an element basis. I have several ideas, but I'm not
> sure if they are valid.
>
> 1. GStreamer Tracer -- This has too much burden on the CPU as far as I
> tested.
>
>
Since 1.16 the latency tracer supports per element latency, and also trace
the latency being reported. The per element latency trace adds a bit of
load, but I've never seen anything close to 1ms overhead (and is constant),
so nothing close to a problem for the quality of the measurements. The
tracing of the reported latency is near to free. All algorithm in this
tracer are 0(1).
I'm sure you can backport this tracer to 1.14 without issues if needed.
> 1. Latency query -- Latency query calculates latency for the
> pipeline/element, and I think it only updates when elements are added or
> removed.
>
> This is tracked by the new latency tracer. When an element has a latency
change, a latency message is posted. It's up to the application to decide
when to update.
> 1. Buffer probe with PTS -- I thought PTS will be a unique ID and will
> not be changed, and we can calculate the running time (absolute time - base
> time) before the buffer comes into the element, and calculate the running
> time after the buffer comes out of the element -- However, it seems that
> buffers can either be dropped or changed -- I wonder in this case, will the
> buffer PTS be changed?
>
> Timestamp on buffers don't really help with measuring latency.
> 1. Buffer probe/new plugin with GstMeta -- If the PTS is not reliable,
> I thought about adding the running time timestamp into buffers using
> GstMeta before coming into the element, and when the buffers come out of
> the element, we can check the added timestamp with the current running time
> which is the latency measurement -- However, again, will the metadata that
> I added be changed in the element?
>
> Same.
_______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190605/97669180/attachment.html>
More information about the gstreamer-devel
mailing list