How to capture the camera(YUV422) to encode H264

I have a yuv422 camera and can display on the screen. But When I throw the data to the encoder, The encoder seems to not work. Is there any example about capture the image(yvu422 v4l2) then encode it? I am using multimedia.
Thanks!

Have a check this document for encode and modify the source sink to v4l2src

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/accelerated_gstreamer.html#wwpID0E0LZ0HA

I know. gst command is ok. But I am using multimedia api. Is multimedia not supported by offical?

Check the …/jetson_multimedia_api/samples/10_camera_recording sample code.
Install the multimedia API sample code by below command.

sudo apt list -a nvidia-l4t-jetson-multimedia-api
sudo apt install nvidia-l4t-jetson-multimedia-api=32.xx.x.xxx