nvgstcapture not working with USB camera

I am using following command for video capture from USB camera but it records for 1 time and then camera freezes. In the preview it shows last captured frame screen and records corrupt mp4 files. How can I make it record in a loop?

nvgstcapture-1.0 -A -C 100 --capture-auto --video-res=4 --capture-time=10 --mode=2 --quit-after=0 --cap-dev-node=1 --camsrc=0 --file-name=Test

You can try splitmuxsink. Please reder to below post: