Latency tracer questions

Nicolas Dufresne nicolas at ndufresne.ca
Thu Jul 7 13:54:14 UTC 2022


Le mercredi 06 juillet 2022 à 15:57 +0000, Miguel Leão via gstreamer-devel a
écrit :
> Hello,
> 
> I am trying to figure out the best way to measure the latency introduced by
> the elements in my pipeline. I was using the latency tracer, but when I
> introduced encoders and decoders (I am decoding H265 video that I received via
> UDP, and re-encoding it and send it again via UDP) the measurements started to
> appear faulty, as I was sending 50fps video and the tracer was telling me that
> the pipeline latency was 4ms. This doesn't make sense because I am sending a
> frame every 20ms, and I need full frames to encode/decode, so the latency
> should be at least 20ms.

The truth about latency depends on the decoder implementation. avdec_h264 makes
a small cheat on the H.264/H.265 spec. If the data coming in is framed, it won't
buffer anything, and will report the "decoding time" without that usually extra
frame latency.

Though, we notice that some work is needed for the case the decoder would be fed
separate slices (N buffer in for 1 buffer out). If this was the case, you may
endup with a false value indeed.

> 
> I saw in the documentation that this tracer only guarantees good performance
> for sources, sinks and filters, is there anyway of measuring latency when
> using codecs?

Link?

> 
> Thanks in advance,
> regards, Miguel



More information about the gstreamer-devel mailing list