Video Encoding using C on Jetson options FFmpeg / Gstreamer / Multimedia API Questions

Hi,
For utilizing hardware encode/decode engines in Jetson, we suggest use gstreamer or jetson_multimedia_api. Please take a look at documents:
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/accelerated_gstreamer.html#
Jetson Linux API Reference: Main Page | NVIDIA Docs

Please take a look. Below is a gstreamer command for video encoding:

$ gst-launch-1.0 videotestsrc num-buffers=100 ! nvvidconv ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=a.mp4

The jetson_multimedia_api sample is in

/usr/src/jetson_multimedia_api/samples/01_video_encode/

We have a package to enable hardware decoding in ffmpeg. And there is a community contribution enabling both encoding and decoding. Please take a look at
Jetson Nano FAQ
[Q: Is hardware acceleration enabled in ffmpeg?]