I don´t know if it´s your case.
Sometime ago I had exactly the same error, but using gstreamer.
The problem was that I was using "default" fps value to configure the camera, it was fps=15. And I was using the "default" fps value for the encoder, it was fps=30
So it resulted in a wrong video.
Could you give this a try?
Could you share your command line?