The nvv4l2decdoer has obvious delay and lag on Jetson Xavier-NX

Hi guys, I have a usb camera with YUYV and H.264 output format, and I try to use nvv4l2decoder to decode it and display, but it has obvious delay and lag. My gst pipeline:

gst-launch-1.0 -vvv v4l2src device=/dev/video2 io-mode=4 ! video/x-h264,width=640,height=480,framerate=30/1 ! nvv4l2decoder ! "video/x-raw(memory:NVMM), format=(string)NV12" ! nv3dsink sync=false

I’ve searched the forums, but still haven’t figured out why, and I try to some solutions like add h264parse and alignment=au before nvv4l2decoder, change io-mode=2 or 4 for v4l2src and some other parameters for nvv4l2decoder, but all of these didn’t work. Since omxh264decoder has been removed from L4T R34, so I didn’t test CPU decoding on Jetson, but I have tested on my local x86 PC, it works very well with avdec_h264.

Any suggestions are welcome.

Hi,
Please set this property to nvv4l2decoder and check if there is improvement:

  enable-max-performance: Set to enable max performance
                        flags: readable, writable
                        Boolean. Default: false

yes, I have tried set this property, but there is no significant improvement

Do you have other suggestions?

Hi,
Please try the command and see if it can achieve target framerate:

$ gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-h264,width=640,height=480,framerate=30/1 ! h264parse ! nvv4l2decoder enable-max-performance=1 ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0

And may try the case of using software decoder avdec_h264 for comparison.