How to automatically measure video latency/jitter from source over network to sink with a gstreamer pipeline

Does anybody know how we can automatically measure video latency from source over network to sink? Ideally it’d also include e.g. jitter and any other measurements.

In our current setup, we measure manually the end-to-end latency between source and sink with taking a picture of source video and sink video that both display a stopwatch, such as https://stopwatch.onlineclock.net/. However, this doesn’t work once we put our robot out in the real world and it is NOT programmatically.

We already measure the source and the sink automatically using gst-shark, but we are missing the measurement that includes the network.

Thanks so much!

P.s. I did see this post to write a gstreamer filter plugin to add markers, but was wondering if there is a better solution:
https://stackoverflow.com/questions/23869562/how-can-i-quantitatively-measure-gstreamer-h264-latency-between-source-and-displ