Nvv4l2h264enc dropping frames on live input

Please try this:
Nvvideoconvert issue, nvvideoconvert in DS4 is better than Ds5? - #3 by DaneLLL

And set the property to nvv4l2h264enc:

  maxperf-enable      : Enable or Disable Max Performance mode
                        flags: readable, writable, changeable only in NULL or READY state
                        Boolean. Default: false

Furthermore, please execute sudo nvpmodel -m 2 and sudo jetson_clocks. The commands can enable CPU/GPU/EMC at maximum clocks.