How to reduce the latency

How to reduce the latency? Here is the test command:
gst-launch-1.0 v4l2src device=“/dev/video0” ! ‘video/x-raw, width=1920,height=1080,format=(string)UYVY’ ! nvvidconv ! “video/x-raw(memory:NVMM),width=1920,height=1080,format=(string)I420” ! nvv4l2h264enc maxperf-enable=1 bitrate=8000000 preset-level=0 num-B-Frames=0 ! nvv4l2decoder enable-max-performance=1 disable-dpb=1 ! nvoverlaysink sync=false max-lateness=-1

I found the latency is about 110ms(1080P60). Is it the right command or it’s the right result?

Hi,
It looks to be optimal gstreamer command. Both encoder and decoder run in max clocks. You may compare to the case without encoder and decoder:

gst-launch-1.0 v4l2src device="/dev/video0" ! "video/x-raw, width=1920,height=1080,format=(string)UYVY" ! nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=(string)I420" ! nvoverlaysink sync=false max-lateness=-1

No encoder and decoder is about 70ms(1080P60). But I want to test the encoder latency and the decoder latency. That means encoder and decoder need about 50ms? And how can I reduce the latency or any suggestions?

@DaneLLL
Is the multimedia api faster than gstream? Because I found the multimedia api latency is less than gst-launch-1.0 command. The capture and display test, the multimedia api is about 40ms, when I set the jetson_clocks. Because my project is sensitive on speed, so I must confirm that. It’s better less than 50ms(capture->convert->encoder->decoder->display)

Hi,
Generally jetson_mutlimedia_api is faster than gstreamer. It it low-level APIs and goes through less layers when comparing to gstreamer. You may check samples in

/usr/src/jetson_multimedia_api