You may use gstreamer for saving to file.
Before trying, be aware that saving raw video can fill your filesystem very quickly, so I’ll limit the number of frames to 100 in the following examples in order to prevent problems, but be sure you have at least 9 GB free on the filesystem you will record to with:
df -H -T
So you may record 100 raw (NV12) frames with:
gst-launch-1.0 -e nvarguscamerasrc num-buffers=100 ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1,format=NV12' ! nvvidconv ! video/x-raw,width=960,height=616 ! filesink location=test.NV12
Be aware that first frames may be dark, or else, argus takes some time to auto adjust everything.
If you want to save individual frames into jpg, you can also try (here limiting to 10 files so keeping frames 90 to 99:
gst-launch-1.0 -e nvarguscamerasrc num-buffers=100 ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1,format=NV12' ! nvvidconv ! video/x-raw,width=960,height=616 ! multifilesink location=test_%05d.jpg max-files=10
If you don’t look for high quality video, you may encode into H264 video (this would save storage space by compressing more than JPG) and save into mp4 container file:
gst-launch-1.0 -e nvarguscamerasrc num-buffers=100 ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1,format=NV12' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=960,height=616' ! nvv4l2h264enc insert-vui=1 ! h264parse ! qtmux ! filesink location=test.mp4