6

I'm using a RTP pipeline to stream video from a camera over local network. The pipeline is: camera > h264enc > RTP > UDP > receiver_and_display

How can I find out how the latency is composed?

sonium
  • 163
  • 5

1 Answers1

3

Nowadays GStreamer has really nice tracers mechanisms to measure latency as for the whole pipeline or for individual elements

This is how this can be done with gst-launch

env GST_DEBUG="GST_TRACER:7" \
    GST_TRACERS="latency(flags=element+pipeline)" \ 
    GST_DEBUG_FILE=./latency.log \
    gst-launch-1.0 -v videotestsrc pattern=snow ! video/x-raw,width=640,height=480,framerate=30/1 ! videoconvert ! autovideosink

./latency.log will contain a lot of logs like this:

...
0:00:06.072184000 40898    0x11d816920 TRACE             GST_TRACER :0:: element-latency, element-id=(string)0x11e848210, element=(string)videotestsrc0, src=(string)src, time=(guint64)16000, ts=(guint64)6072172000;
0:00:06.072209000 40898    0x11d816920 TRACE             GST_TRACER :0:: element-latency, element-id=(string)0x11e850440, element=(string)capsfilter0, src=(string)src, time=(guint64)28000, ts=(guint64)6072200000;
0:00:06.072224000 40898    0x11d816920 TRACE             GST_TRACER :0:: element-latency, element-id=(string)0x11e824660, element=(string)videoconvert0, src=(string)src, time=(guint64)17000, ts=(guint64)6072217000;
0:00:06.072468000 40898    0x11d816920 TRACE             GST_TRACER :0:: element-latency, element-id=(string)0x11e83f280, element=(string)autovideosink0, src=(string)src, time=(guint64)21594000, ts=(guint64)6072456000;
....

So here you have a starting point to analyze latency (time=(guint64)... values) per element and experiment with different settings

More details in this article https://gstreamer.freedesktop.org/documentation/additional/design/tracing.html?gi-language=c#use-cases

CAMOBAP
  • 220
  • 2
  • 9