How to use v4l2 to capture videos in Jetson Orin r35 Jetpack 5.0 and encode them using a hardware encoding chip

Continuing the discussion from tegra multimedia samples not working properly:

Duplicated with How to use v4l2 to capture videos in Jetson Orin r35 Jetpack 5.0 and encode them using a hardware encoding chip - Jetson & Embedded Systems / Jetson AGX Orin - NVIDIA Developer Forums