Hi,
I use jetson nano to encode YUV420 to H264. I try to run the AppEncGL.cpp in video_codec_sdk_10.0.26. But when i load the function of LoadNvEncApi(), it returned error. the function is below here:
void NvEncoder::LoadNvEncApi()
{
uint32_t version = 0;
uint32_t currentVersion = (NVENCAPI_MAJOR_VERSION << 4) | NVENCAPI_MINOR_VERSION;
NVENC_API_CALL(NvEncodeAPIGetMaxSupportedVersion(&version));
if (currentVersion > version)
{
NVENC_THROW_ERROR("Current Driver Version does not support this NvEncodeAPI version, please upgrade driver", NV_ENC_ERR_INVALID_VERSION);
}
m_nvenc = { NV_ENCODE_API_FUNCTION_LIST_VER };
NVENC_API_CALL(NvEncodeAPICreateInstance(&m_nvenc));
}
\\
#define NVENC_API_CALL( nvencAPI ) \
do \
{ \
NVENCSTATUS errorCode = nvencAPI; \
if( errorCode != NV_ENC_SUCCESS) \
{ \
std::ostringstream errorLog; \
errorLog << #nvencAPI << " returned error " << errorCode; \
throw NVENCException::makeNVENCException(errorLog.str(), errorCode, __FUNCTION__, __FILE__, __LINE__); \
} \
} while (0)
// NvEncodeAPIGetMaxSupportedVersion
/**
- \brief Get the largest NvEncodeAPI version supported by the driver.
- This function can be used by clients to determine if the driver supports
- the NvEncodeAPI header the application was compiled with.
- \param [out] version
- Pointer to the requested value. The 4 least significant bits in the returned
- indicate the minor version and the rest of the bits indicate the major
- version of the largest supported version.
- \return
- ::NV_ENC_SUCCESS \n
- ::NV_ENC_ERR_INVALID_PTR \n
/
NVENCSTATUS NVENCAPI NvEncodeAPIGetMaxSupportedVersion (uint32_t version);
According to the return, I got a errno of NV_ENC_ERR_INVALID_PTR. But I do not know how I pass a wrong pointer.
Additionally, I have setup the cuda10.0 and openGL lib.
Any help will be grateful.