I use the nvEncodeAPI_v12.1.h from the Video Codec Interface and I do not get the valid presets of a codec with the call of NvEncGetEncodePresetGUIDs.
It seems that there is a mistake in the .h file: a wrong reuse of PNVENCGETENCODEPRESETGUIDS for both nvEncGetEncodePresetGUIDs and nvEncGetEncodeProfileGUIDs.
Same for PNVENCGETENCODEPRESETCOUNT.
Here is a patch submission:
--- "a/nvEncodeAPI_v12.1.h"
+++ "b/nvEncodeAPI_v12.1_new.h"
@@ -4374,8 +4374,8 @@ typedef struct _NV_ENCODE_API_FUNCTION_LIST
uint32_t reserved; /**< [in]: Reserved and should be set to 0. */
PNVENCOPENENCODESESSION nvEncOpenEncodeSession; /**< [out]: Client should access ::NvEncOpenEncodeSession() API through this pointer. */
PNVENCGETENCODEGUIDCOUNT nvEncGetEncodeGUIDCount; /**< [out]: Client should access ::NvEncGetEncodeGUIDCount() API through this pointer. */
- PNVENCGETENCODEPRESETCOUNT nvEncGetEncodeProfileGUIDCount; /**< [out]: Client should access ::NvEncGetEncodeProfileGUIDCount() API through this pointer.*/
- PNVENCGETENCODEPRESETGUIDS nvEncGetEncodeProfileGUIDs; /**< [out]: Client should access ::NvEncGetEncodeProfileGUIDs() API through this pointer. */
+ PNVENCGETENCODEPROFILEGUIDCOUNT nvEncGetEncodeProfileGUIDCount; /**< [out]: Client should access ::NvEncGetEncodeProfileGUIDCount() API through this pointer.*/
+ PNVENCGETENCODEPROFILEGUIDS nvEncGetEncodeProfileGUIDs; /**< [out]: Client should access ::NvEncGetEncodeProfileGUIDs() API through this pointer. */
PNVENCGETENCODEGUIDS nvEncGetEncodeGUIDs; /**< [out]: Client should access ::NvEncGetEncodeGUIDs() API through this pointer. */
PNVENCGETINPUTFORMATCOUNT nvEncGetInputFormatCount; /**< [out]: Client should access ::NvEncGetInputFormatCount() API through this pointer. */
PNVENCGETINPUTFORMATS nvEncGetInputFormats; /**< [out]: Client should access ::NvEncGetInputFormats() API through this pointer. */