NVENC , output video file with laggy

Hello sir,
I develop my desk app with nvenc.I create a d3d11 window to draw the image stream from camera, and at the same to recording it.My d3d11 window is very smoothly with vsync. But I find the final h264/h265 video is laggy.

Someone said to disable G-sync ,I cannot find it in nvidia panel, and not sure if it is the reason.

My environment below:

geforce gtx1070,
a normal monitor for display,
nvidia version 441.66,

Target resolution:1920x1080,60fps

I test many different groups of parameters,such as presetGUID,profileGUID,rcMode,gop,frameIntervalP, but the result is same,laggy !

After testing carefully , no frame missed.

I put the output video to Premiere, just found some frames are same to the previous, and some frames are not steay.
I just rotated my camera when recording.

Now it is OK.