Jetson nano with opencv with libuvc videowriter not working

Hi,
I am using jetson nano with Jetpack4.4 with opencv 4.4.0.

I have interfaced a purethermal based lepton camera module(USB based module) that uses “libuvc” library to access the camera frame.
There is no issue with camera access and I am able to get the video stream and visualised properly.

Issue-
When i am using opencv API to store the video like-
“VideoWriter video(“video.avi”,VideoWriter::fourcc(‘M’,‘J’,‘P’,‘G’),fps, Size(width,height),0);”, there is only file named as “video.avi” generated but no data is there.

Troubleshooting-
I know frame rate and frame size must be same to what is input from camera. I have done that by libuvc APIs. But no solution.

Any help will be appreciated.
If required i can share the code also.
Thanks.

Hi,
Please refer to this sample:

Thanks for the reference.