How can I measure latency at specific parts(encoding latency,decoding latency) of my live stream?

How can I measure the latencies at specific part of the live stream process?

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=3280, height=1848, framerate=28/1, format=NV12'  ! nvvidconv left=200 right=3080 top=600 bottom=1200 !  'video/x-raw,width=2880, height=600, framerate=28/1, format=NV12, pixel-aspect-ratio=1/1' ! nvvidconv ! nvv4l2h264enc preset-level=4 MeasureEncoderLatency=1 ! h264parse ! flvmux ! rtmpsink location='rtmp://164.78.185.96/live/'

I found

MeasureEncoderLatency=1

a good tool for encoder latency but is there a code that I can do the same with what capturing video process and decoder latency? Thank you!

hello UAVstreaming,

please access L4T Multimedia API for the lower-level APIs sample codes.
you may also check the samples for encoding, decoding, scaling, and other media functions
you might add the NvOsGetTimeUS() function call to take a snapshot of system timestamps.
suggest you should also refer to Multimedia API Sample Applications for the documentation of sample applications.
thanks