Alternative to using Tracing to compute pipeline latency?

Ben Rush ben at ben-rush.net
Tue Aug 24 16:22:01 UTC 2021


My problem might be the result of misunderstanding the logging and tracing
capabilities of GStreamer. If so, I apologize.

Fundamentally what I want to do is measure the pipeline latencies for 3
media streams inside my RTSP server individually; so, my setup is an RTSP
server running 3 separate media pipelines and for each I want to get back
latency metrics. I see that the "standard" way of doing this (at least the
most well-advertised) is to use Tracing and hook into GST_DEBUG to get
latency metrics: GST_DEBUG="GST_TRACER:7" GST_TRACERS=latency, for example.

I tried this: I set the GST_DEBUG and GST_TRACERS environment variables
from my C code and subsequently got back a wealth of latency-related
information to standard error. But that's also my problem: my server is
written in C, and GST_DEBUG writes to standard error. I would prefer to
have some well defined mechanism through which I could query the pipeline
latency on an as-needed basis instead of hook into standard error and parse
strings. Is this possible? Is there documentation or example code showing
how to do this?

I looked at gst_tracing_register_hook and, while it looks as though it
would be what I want (because it registers a callback to the specific
tracing hooks I'm interested in), I'm not finding good documentation or
example code about how to use it outside of a module in the pipeline
itself. For example, most of the code I'm seeing while searching GitHub for
this function is GstLatency.c itself, which begs the question of whether
this API can be used by anything other than a plugin of the pipeline I'm
inspecting? Will I need to write or extend a tracing plugin to do what I
need, then? Can I not use this function from my RTSP server code to
register a callback to these hooks?

Thanks, and I apologize of the question isn't clearly stated. I'm clearly
not understanding something.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210824/fd825bca/attachment.htm>


More information about the gstreamer-devel mailing list