# Measuring glass to glass latency

**URL:** <https://discourse.gstreamer.org/t/measuring-glass-to-glass-latency/2357>\
**Category:** Application Development\
**Created:** [September 10, 2024, 12:17pm UTC](https://discourse.gstreamer.org/t/measuring-glass-to-glass-latency/2357 "2024-09-10T12:17:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FabPoll](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/fabpoll/32/1620_2.png) [@FabPoll](https://discourse.gstreamer.org/u/FabPoll)\
**Post date:** [September 10, 2024, 12:17pm UTC](https://discourse.gstreamer.org/t/measuring-glass-to-glass-latency/2357/1 "2024-09-10T12:17:12Z")

</div>

HI all,

I am currently working on a project where I need to estimate the glass-to-glass latency of my system. I have a simple camera that I use to frame a precise timer, and I display the live captured frame on the same computer. I then take several screenshots to measure the time difference.

 ![image](https://discourse.gstreamer.org/uploads/default/original/1X/a0461e05e1ee4335b99a9cecddc1adcc888b4794.jpeg)

My GStreamer pipeline reports a latency of 45 milliseconds, with 30 milliseconds from the camera _appsrc_ and 15 milliseconds of processing-deadline. This is in line with the data captured by the tracers.

 ![pipeline_full.dot](https://discourse.gstreamer.org/uploads/default/original/1X/61789c78d755a271e6054511973a9070eb7e182a.png)

 ![Figure_1](https://discourse.gstreamer.org/uploads/default/original/1X/ef5769a6d6b307f001fede6b65e289d0148d1b19.png)

However, the measured latency is still approximately 120 milliseconds. I am curious if there is any additional buffering occurring somewhere in the system, as the vsync is disabled.

I would greatly appreciate any insights or suggestions you might have regarding this issue

Fabien

---

<div class="post-metadata">

**Author:** ![ndufresne](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/ndufresne/32/10_2.png) [@ndufresne](https://discourse.gstreamer.org/u/ndufresne)\
**Post date:** [September 10, 2024, 11:34pm UTC](https://discourse.gstreamer.org/t/measuring-glass-to-glass-latency/2357/2 "2024-09-10T23:34:34Z")

</div>

You allow for 100 buffers on capture queue, and probably that the delay is matching your timestamp?

---

<div class="post-metadata">

**Author:** ![FabPoll](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/fabpoll/32/1620_2.png) [@FabPoll](https://discourse.gstreamer.org/u/FabPoll)\
**Post date:** [September 12, 2024, 7:57am UTC](https://discourse.gstreamer.org/t/measuring-glass-to-glass-latency/2357/3 "2024-09-12T07:57:05Z")

</div>

Even with the max-buffers at 1 the delay stays the same

---

<div class="post-metadata">

**Author:** ![ndufresne](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/ndufresne/32/10_2.png) [@ndufresne](https://discourse.gstreamer.org/u/ndufresne)\
**Post date:** [September 12, 2024, 11:13am UTC](https://discourse.gstreamer.org/t/measuring-glass-to-glass-latency/2357/4 "2024-09-12T11:13:53Z")

</div>

One last thing you can check, set sync=0 on glimagesink, that will workaround any timestamp issues, if the delay stay the same, then it’s an external one, which is the code the feeds appsrc, and the path from rendered GL canvas to your display.

---

<div class="post-metadata">

**Author:** ![FabPoll](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/fabpoll/32/1620_2.png) [@FabPoll](https://discourse.gstreamer.org/u/FabPoll)\
**Post date:** [September 16, 2024, 7:18am UTC](https://discourse.gstreamer.org/t/measuring-glass-to-glass-latency/2357/5 "2024-09-16T07:18:39Z")

</div>

Thanks I’ll continue to investigate. I’ll let you know if I find anything.

Rewriting the appsrc from python to rust doesn’t change much. There is a simple loop that pass the frames from the camera to the appsrc.push\_buffer().
