You can check the MMAPI sample code. Like 12_v4l2_camera_cuda/18_v4l2_camera_cuda_rgb instead of argus camera for YUV sensor.
nvidia@nvidia-desktop:/usr/src/jetson_multimedia_api/samples$ l
00_video_decode/ 03_video_cuda_enc/ 06_jpeg_decode/ 09_argus_camera_jpeg/ 12_v4l2_camera_cuda/ 15_multivideo_encode/ 18_v4l2_camera_cuda_rgb/ Rules.mk
01_video_encode/ 04_video_dec_trt/ 07_video_convert/ 10_argus_camera_recording/ 13_argus_multi_camera/ 16_multivideo_transcode/ backend/ unittest_samples/
02_video_dec_cuda/ 05_jpeg_encode/ 08_video_dec_drm/ 11_video_osd/ 14_multivideo_decode/ 17_frontend/ common/