How to convert a 16 bit grayscale image to RGB and then stream it over H264

Looks like the sensor mode is not set correctly. Please run v4l2-ctl to show supported formats and set exact mode to the capability. There are steps for reference in Jetson Nano FAQ
Q: I have a USB camera. How can I launch it on Jetson Nano?