blackforestcowboy
blackforestcowboy

Reputation: 1021

How to measure intra GStreamer/gst-launch latency

im currently building a GStreamer pipleine on my Raspberry PI as follows:

v4lsrc - h264enc - mpegtsmux - udpsink

im try to figure out how to measure the time in milliseconds for one or several elements, eg. the time consumed by h264enc and mpegtsmux.

Of course I found the following entry which solves this problem by using a gstreamer plugin:

How can I quantitatively measure gstreamer H264 latency between source and display?

But i'm not really sure how to compile such a plugin. Especially on the Raspberry Pi! Ive read that every GStreamer Element needs to calculate its latency anyway. Would be super cool if anybody could help me with that! Cheers, Markus

Upvotes: 0

Views: 3987

Answers (1)

mpr
mpr

Reputation: 3378

I don't think there's an out-of-the-box way to do this. In the past we used to wrap a pair of identity elements around the element to be measured, and added it to a bin. Very clunky.

I went ahead and uploaded some code that uses the new GstMeta API and two new elements: markin and markout. So you can use it like so:

export GST_DEBUG=markout:5

gst-launch-1.0 -f -e videotestsrc pattern=ball ! video/x-raw,width=320,height=240 ! markin name=moo ! videoscale ! markout ! video/x-raw,width=1280,height=720 ! ximagesink

https://github.com/mpekar/gstreamer_timestamp_marking

Upvotes: 1

Related Questions