Checking Reported Latencies of Individual Elements of Pipeline - 2023.1 English

H.264/H.265 Video Codec Unit v1.2 Solutions LogiCORE IP Product Guide (PG252)

Document ID
Release Date
2023.1 English

Modify as below:

To check the reported latencies of each element, run the following command:

GST_DEBUG=*v4l2*:6,*omx*:6,*base*:6 GST_DEBUG_FILE="/run/latency.txt” 
gst-launch-1.0 <pipeline>
grep -inr "latency” /run/latency.txt | grep v4l2 
grep -inr “latency” /run/latency.txt | grep omx

This should show the latency reported by v4l2src, encoder and decoder. For example, for the following use-case:

GST_DEBUG="*v4l2*:6,*omx*:6,*base*:6" GST_DEBUG_FILE="/run/serial_4k_avc.txt" gst-launch-1.0 -v v4l2src io-mode=dmabuf num-buffers=100 device=/dev/video0 ! video/x-raw, width=3840, height=2160, format=NV12, framerate=60/1 ! omxh264enc control-rate=low-latency target-bitrate=25000 filler-data=0 prefetch-buffer=TRUE num-slices=8 periodicity-idr=240 cpb-size=500 gdr-mode=horizontal initial-delay=250 gop-mode=low-delay-p ! video/x-h264, alignment=nal ! queue max-size-buffers=0 ! omxh264dec low-latency=1 ! queue max-size-bytes=0 ! fpsdisplaysink name=fpssink text-overlay=false 'video-sink=kmssink bus-id=a0070000.v_mix plane-id=33 hold-extra-sample=1 show-preroll=false sync=true fullscreen-overlay=1' sync=true -v

Checking v4l2 reported latency:

grep -inr "report latency" serial_avc.txt | grep "v4l2"
0:00:00.895191805 15284   0x7f98004850 DEBUG                v4l2src gstv4l2src.c:779:gst_v4l2src_query: report latency min 0:00:00.016666666 max 0:00:00.533333312

According to the above log, the v4l2src reported latency is 16.66 ms.

Checking OMX encoder reported latency:

grep -inr "latency" serial_avc.txt | grep "omxh264enc"  
0:00:00.349687650 15284   0x556fe762d0 DEBUG  omxvideoenc gstomxvideoenc.c:2461:gst_omx_video_enc_set_latency:h264enc0> retrieved latency of 10 ms

According to the above log, the encoder reported latency is 10 ms.

Checking OMX decoder reported latency:

grep -inr "latency" serial_avc.txt | grep "omxh264dec"
0:00:00.459566429 15284   0x556ff60000 DEBUG  omxvideodec gstomxvideodec.c:2483:gst_omx_video_dec_set_latency:h264dec0> retrieved latency of 17 ms