简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM