How to convert YUYV to H.264 and record?

Hi,
Please refer to FAQ
Q: I have a USB camera. How can I lauch it on Jetson Nano?

If you are able to see preview, you can replace nvoverlaysink with

nvv4l2h264enc ! h264parse ! qtmux ! filesink location=a.mp4

to get a mp4 file.