Webcam Pipeline With Least Amount of Latency

Currently my pipeline is as follows-

v4l2src → …YUY2… → videoconvert → nvvideoconvert ->…->nveglglesink(max-lateness is set to 1000000000000000000)

I’m running DeepStream on a dGPU. There is a significant constant latency for some reason.

Improved the latency somewhat by making the tiler width and height exactly same as streammux width and height.

Why do you need to use videoconvert which is not owned by NV and the plugin will consume more cpu time.

My webcam supports YUV2 and MJPEG, can nvvideoconvert take this input directly?

I used this pipeline How to run deepstream-test3 with usb camera - #15 by DaneLLL

nvvideoconvert can support:

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                 format: { (string)I420, (string)NV12, (string)P010_10LE, (string)BGRx, (string)RGBA, (string)GRAY8 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: { (string)I420, (string)NV12, (string)P010_10LE, (string)BGRx, (string)RGBA, (string)GRAY8 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                 format: { (string)I420, (string)NV12, (string)P010_10LE, (string)BGRx, (string)RGBA, (string)GRAY8 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: { (string)I420, (string)P010_10LE, (string)NV12, (string)BGRx, (string)RGBA, (string)GRAY8 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

Can you try following pipeline:
v4l2src → …MJPEG… ->nvv4l2decoder-> nvvideoconvert ->…->nveglglesink
or
v4l2src → …YUY2… ->videoconvert-> nvvideoconvert ->“video/x-raw(memory:NVMM)”…->nveglglesink

Tried it, there is latency for some reason. I am using a machine with a 2080ti and also Jetson.
Maybe there is some nvstreammux configuration that is causing the lag? I am not using the config file pipeline, I have made a customized app with the pipeline defined in the app.