Some more queries/discrepancies:
What is the difference between V4L2_CID_MPEG_VIDEOENC_HW_PRESET_TYPE_PARAM and V4L2_CID_MPEG_VIDEOENC_CUDA_PRESET_ID? The former only seems to allow a smaller range of presets vs what NVENC is capable of. The latter suggests I can use a value 1-7, which is consistent with the 7 definitions in the desktop VIDEO SDK. So can I use the latter instead?
The sample code seems to use V4L2_CID_MPEG_VIDEOENC_HW_PRESET_TYPE_PARAM, but the comment underneath this definition in the file v4l2_nv_extensions.h suggests you have to fill out a v4l2_enc_hw_preset_type_param structure. However, the sample code does not do this, instead setting the control.value directly to the hw_preset_type, instead of the address of a filled-out structure. Is the sample code wrong, or the comment for how to use this control wrong?
Can I use V4L2_CID_MPEG_VIDEOENC_CUDA_TUNING_INFO? None of the samples or wrappers use it.
With the above two definitions, what is the meaning of “CUDA” in this context (e.g… CUDA_TUNING_INFO_). Does it only apply when I’m using CUDA surfaces or something? In the comments it refers to something called “CUVID Encoder”. What is a “CUVID Encoder” is it the same as NVENC, or something different?
What is the difference between V4L2_CID_MPEG_VIDEOENC_FORCE_IDR_FRAME and V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE? Which should I use if I want to force an IDR frame, the first one, presumably? However, in the sample code there is a function enc->forceIDR() that uses V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE, so now I’m not sure?
As a whole, the sample code seems pretty rough, if I may say so! Lots of duplicated blocks of code (for example huge chunks for reading the initial frames from a video file into the output planes, and then the same code pasted doing similiar/the same inside the encoder_proc_xxx functions)., Lots of evidence of lots of past changes, resulting in blocks like this (this is inside encode_unit_test)
bool stop_dqthread = false;
// lots of code, but none of it using stop_dqthread!
stop_dqthread = true;
It’s hard to actually figure out what is old legacy code and what is the modern way to do things, but I’ll struggle on :)
The VIDEO SDK documentation was fantastic in comparison and always kept up to date with new releases etc.