Hi,
01_video_encode sample should be a complete sample for video encoding. Beside it, you can also check
/usr/src/jetson_multimedia_api/samples/unittest_samples/encoder_unit_sample/
And this patch to 12 sample:
How to use v4l2 to capture videos in Jetson Orin r35 Jetpack 5.0 and encode them using a hardware encoding chip - #8 by DaneLLL