FFmpeg
|
Functions | |
NVENCSTATUS NVENCAPI | NvEncOpenEncodeSession (void *device, uint32_t deviceType, void **encoder) |
Opens an encoding session. More... | |
NVENCSTATUS NVENCAPI | NvEncGetEncodeGUIDCount (void *encoder, uint32_t *encodeGUIDCount) |
Retrieves the number of supported encode GUIDs. More... | |
NVENCSTATUS NVENCAPI | NvEncGetEncodeGUIDs (void *encoder, GUID *GUIDs, uint32_t guidArraySize, uint32_t *GUIDCount) |
Retrieves an array of supported encoder codec GUIDs. More... | |
NVENCSTATUS NVENCAPI | NvEncGetEncodeProfileGUIDCount (void *encoder, GUID encodeGUID, uint32_t *encodeProfileGUIDCount) |
Retrieves the number of supported profile GUIDs. More... | |
NVENCSTATUS NVENCAPI | NvEncGetEncodeProfileGUIDs (void *encoder, GUID encodeGUID, GUID *profileGUIDs, uint32_t guidArraySize, uint32_t *GUIDCount) |
Retrieves an array of supported encode profile GUIDs. More... | |
NVENCSTATUS NVENCAPI | NvEncGetInputFormatCount (void *encoder, GUID encodeGUID, uint32_t *inputFmtCount) |
Retrieve the number of supported Input formats. More... | |
NVENCSTATUS NVENCAPI | NvEncGetInputFormats (void *encoder, GUID encodeGUID, NV_ENC_BUFFER_FORMAT *inputFmts, uint32_t inputFmtArraySize, uint32_t *inputFmtCount) |
Retrieves an array of supported Input formats. More... | |
NVENCSTATUS NVENCAPI | NvEncGetEncodeCaps (void *encoder, GUID encodeGUID, NV_ENC_CAPS_PARAM *capsParam, int *capsVal) |
Retrieves the capability value for a specified encoder attribute. More... | |
NVENCSTATUS NVENCAPI | NvEncGetEncodePresetCount (void *encoder, GUID encodeGUID, uint32_t *encodePresetGUIDCount) |
Retrieves the number of supported preset GUIDs. More... | |
NVENCSTATUS NVENCAPI | NvEncGetEncodePresetGUIDs (void *encoder, GUID encodeGUID, GUID *presetGUIDs, uint32_t guidArraySize, uint32_t *encodePresetGUIDCount) |
Receives an array of supported encoder preset GUIDs. More... | |
NVENCSTATUS NVENCAPI | NvEncGetEncodePresetConfig (void *encoder, GUID encodeGUID, GUID presetGUID, NV_ENC_PRESET_CONFIG *presetConfig) |
Returns a preset config structure supported for given preset GUID. More... | |
NVENCSTATUS NVENCAPI | NvEncInitializeEncoder (void *encoder, NV_ENC_INITIALIZE_PARAMS *createEncodeParams) |
Initialize the encoder. More... | |
NVENCSTATUS NVENCAPI | NvEncCreateInputBuffer (void *encoder, NV_ENC_CREATE_INPUT_BUFFER *createInputBufferParams) |
Allocates Input buffer. More... | |
NVENCSTATUS NVENCAPI | NvEncDestroyInputBuffer (void *encoder, NV_ENC_INPUT_PTR inputBuffer) |
Release an input buffers. More... | |
NVENCSTATUS NVENCAPI | NvEncCreateBitstreamBuffer (void *encoder, NV_ENC_CREATE_BITSTREAM_BUFFER *createBitstreamBufferParams) |
Allocates an output bitstream buffer. More... | |
NVENCSTATUS NVENCAPI | NvEncDestroyBitstreamBuffer (void *encoder, NV_ENC_OUTPUT_PTR bitstreamBuffer) |
Release a bitstream buffer. More... | |
NVENCSTATUS NVENCAPI | NvEncEncodePicture (void *encoder, NV_ENC_PIC_PARAMS *encodePicParams) |
Submit an input picture for encoding. More... | |
NVENCSTATUS NVENCAPI | NvEncLockBitstream (void *encoder, NV_ENC_LOCK_BITSTREAM *lockBitstreamBufferParams) |
Lock output bitstream buffer. More... | |
NVENCSTATUS NVENCAPI | NvEncUnlockBitstream (void *encoder, NV_ENC_OUTPUT_PTR bitstreamBuffer) |
Unlock the output bitstream buffer. More... | |
NVENCSTATUS NVENCAPI | NvEncLockInputBuffer (void *encoder, NV_ENC_LOCK_INPUT_BUFFER *lockInputBufferParams) |
Locks an input buffer. More... | |
NVENCSTATUS NVENCAPI | NvEncUnlockInputBuffer (void *encoder, NV_ENC_INPUT_PTR inputBuffer) |
Unlocks the input buffer. More... | |
NVENCSTATUS NVENCAPI | NvEncGetEncodeStats (void *encoder, NV_ENC_STAT *encodeStats) |
Get encoding statistics. More... | |
NVENCSTATUS NVENCAPI | NvEncGetSequenceParams (void *encoder, NV_ENC_SEQUENCE_PARAM_PAYLOAD *sequenceParamPayload) |
Get encoded sequence and picture header. More... | |
NVENCSTATUS NVENCAPI | NvEncRegisterAsyncEvent (void *encoder, NV_ENC_EVENT_PARAMS *eventParams) |
Register event for notification to encoding completion. More... | |
NVENCSTATUS NVENCAPI | NvEncUnregisterAsyncEvent (void *encoder, NV_ENC_EVENT_PARAMS *eventParams) |
Unregister completion event. More... | |
NVENCSTATUS NVENCAPI | NvEncMapInputResource (void *encoder, NV_ENC_MAP_INPUT_RESOURCE *mapInputResParams) |
Map an externally created input resource pointer for encoding. More... | |
NVENCSTATUS NVENCAPI | NvEncUnmapInputResource (void *encoder, NV_ENC_INPUT_PTR mappedInputBuffer) |
UnMaps a NV_ENC_INPUT_PTR which was mapped for encoding. More... | |
NVENCSTATUS NVENCAPI | NvEncDestroyEncoder (void *encoder) |
Destroy Encoding Session. More... | |
NVENCSTATUS NVENCAPI | NvEncInvalidateRefFrames (void *encoder, uint64_t invalidRefFrameTimeStamp) |
Invalidate reference frames. More... | |
NVENCSTATUS NVENCAPI | NvEncOpenEncodeSessionEx (NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS *openSessionExParams, void **encoder) |
Opens an encoding session. More... | |
NVENCSTATUS NVENCAPI | NvEncRegisterResource (void *encoder, NV_ENC_REGISTER_RESOURCE *registerResParams) |
Registers a resource with the Nvidia Video Encoder Interface. More... | |
NVENCSTATUS NVENCAPI | NvEncUnregisterResource (void *encoder, NV_ENC_REGISTERED_PTR registeredResource) |
Unregisters a resource previously registered with the Nvidia Video Encoder Interface. More... | |
NVENCSTATUS NVENCAPI | NvEncReconfigureEncoder (void *encoder, NV_ENC_RECONFIGURE_PARAMS *reInitEncodeParams) |
Reconfigure an existing encoding session. More... | |
NVENCSTATUS NVENCAPI | NvEncCreateMVBuffer (void *encoder, NV_ENC_CREATE_MV_BUFFER *createMVBufferParams) |
Allocates output MV buffer for ME only mode. More... | |
NVENCSTATUS NVENCAPI | NvEncDestroyMVBuffer (void *encoder, NV_ENC_OUTPUT_PTR mvBuffer) |
Release an output MV buffer for ME only mode. More... | |
NVENCSTATUS NVENCAPI | NvEncRunMotionEstimationOnly (void *encoder, NV_ENC_MEONLY_PARAMS *meOnlyParams) |
Submit an input picture and reference frame for motion estimation in ME only mode. More... | |
NVENCSTATUS NVENCAPI | NvEncodeAPIGetMaxSupportedVersion (uint32_t *version) |
Get the largest NvEncodeAPI version supported by the driver. More... | |
NVENCSTATUS NVENCAPI | NvEncodeAPICreateInstance (NV_ENCODE_API_FUNCTION_LIST *functionList) |
Entry Point to the NvEncodeAPI interface. More... | |
NVENCSTATUS NVENCAPI NvEncOpenEncodeSession | ( | void * | device, |
uint32_t | deviceType, | ||
void ** | encoder | ||
) |
NVENCSTATUS NVENCAPI NvEncGetEncodeGUIDCount | ( | void * | encoder, |
uint32_t * | encodeGUIDCount | ||
) |
Retrieves the number of supported encode GUIDs.
The function returns the number of codec guids supported by the NvEncodeAPI interface.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[out] | encodeGUIDCount | Number of supported encode GUIDs. |
NVENCSTATUS NVENCAPI NvEncGetEncodeGUIDs | ( | void * | encoder, |
GUID * | GUIDs, | ||
uint32_t | guidArraySize, | ||
uint32_t * | GUIDCount | ||
) |
Retrieves an array of supported encoder codec GUIDs.
The function returns an array of codec guids supported by the NvEncodeAPI interface. The client must allocate an array where the NvEncodeAPI interface can fill the supported guids and pass the pointer in *GUIDs
parameter. The size of the array can be determined by using NvEncGetEncodeGUIDCount() API. The Nvidia Encoding interface returns the number of codec guids it has actually filled in the guid array in the GUIDCount
parameter.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | guidArraySize | Number of GUIDs to retrieved. Should be set to the number retrieved using NvEncGetEncodeGUIDCount. |
[out] | GUIDs | Array of supported Encode GUIDs. |
[out] | GUIDCount | Number of supported Encode GUIDs. |
NVENCSTATUS NVENCAPI NvEncGetEncodeProfileGUIDCount | ( | void * | encoder, |
GUID | encodeGUID, | ||
uint32_t * | encodeProfileGUIDCount | ||
) |
Retrieves the number of supported profile GUIDs.
The function returns the number of profile GUIDs supported for a given codec. The client must first enumerate the codec guids supported by the NvEncodeAPI interface. After determining the codec guid, it can query the NvEncodeAPI interface to determine the number of profile guids supported for a particular codec guid.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | encodeGUID | The codec guid for which the profile guids are being enumerated. |
[out] | encodeProfileGUIDCount | Number of encode profiles supported for the given encodeGUID. |
NVENCSTATUS NVENCAPI NvEncGetEncodeProfileGUIDs | ( | void * | encoder, |
GUID | encodeGUID, | ||
GUID * | profileGUIDs, | ||
uint32_t | guidArraySize, | ||
uint32_t * | GUIDCount | ||
) |
Retrieves an array of supported encode profile GUIDs.
The function returns an array of supported profile guids for a particular codec guid. The client must allocate an array where the NvEncodeAPI interface can populate the profile guids. The client can determine the array size using NvEncGetEncodeProfileGUIDCount() API. The client must also validiate that the NvEncodeAPI interface supports the GUID the client wants to pass as encodeGUID
parameter.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | encodeGUID | The encode guid whose profile guids are being enumerated. |
[in] | guidArraySize | Number of GUIDs to be retrieved. Should be set to the number retrieved using NvEncGetEncodeProfileGUIDCount. |
[out] | profileGUIDs | Array of supported Encode Profile GUIDs |
[out] | GUIDCount | Number of valid encode profile GUIDs in profileGUIDs array. |
NVENCSTATUS NVENCAPI NvEncGetInputFormatCount | ( | void * | encoder, |
GUID | encodeGUID, | ||
uint32_t * | inputFmtCount | ||
) |
Retrieve the number of supported Input formats.
The function returns the number of supported input formats. The client must query the NvEncodeAPI interface to determine the supported input formats before creating the input surfaces.
NVENCSTATUS NVENCAPI NvEncGetInputFormats | ( | void * | encoder, |
GUID | encodeGUID, | ||
NV_ENC_BUFFER_FORMAT * | inputFmts, | ||
uint32_t | inputFmtArraySize, | ||
uint32_t * | inputFmtCount | ||
) |
Retrieves an array of supported Input formats.
Returns an array of supported input formats The client must use the input format to create input surface using NvEncCreateInputBuffer() API.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | encodeGUID | Encode GUID, corresponding to which the number of supported input formats is to be retrieved. |
[in] | inputFmtArraySize | Size input format count array passed in inputFmts . |
[out] | inputFmts | Array of input formats supported for this Encode GUID. |
[out] | inputFmtCount | The number of valid input format types returned by the NvEncodeAPI interface in inputFmts array. |
NVENCSTATUS NVENCAPI NvEncGetEncodeCaps | ( | void * | encoder, |
GUID | encodeGUID, | ||
NV_ENC_CAPS_PARAM * | capsParam, | ||
int * | capsVal | ||
) |
Retrieves the capability value for a specified encoder attribute.
The function returns the capability value for a given encoder attribute. The client must validate the encodeGUID using NvEncGetEncodeGUIDs() API before calling this function. The encoder attribute being queried are enumerated in NV_ENC_CAPS_PARAM enum.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | encodeGUID | Encode GUID, corresponding to which the capability attribute is to be retrieved. |
[in] | capsParam | Used to specify attribute being queried. Refer NV_ENC_CAPS_PARAM for more details. |
[out] | capsVal | The value corresponding to the capability attribute being queried. |
NVENCSTATUS NVENCAPI NvEncGetEncodePresetCount | ( | void * | encoder, |
GUID | encodeGUID, | ||
uint32_t * | encodePresetGUIDCount | ||
) |
Retrieves the number of supported preset GUIDs.
The function returns the number of preset GUIDs available for a given codec. The client must validate the codec guid using NvEncGetEncodeGUIDs() API before calling this function.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | encodeGUID | Encode GUID, corresponding to which the number of supported presets is to be retrieved. |
[out] | encodePresetGUIDCount | Receives the number of supported preset GUIDs. |
NVENCSTATUS NVENCAPI NvEncGetEncodePresetGUIDs | ( | void * | encoder, |
GUID | encodeGUID, | ||
GUID * | presetGUIDs, | ||
uint32_t | guidArraySize, | ||
uint32_t * | encodePresetGUIDCount | ||
) |
Receives an array of supported encoder preset GUIDs.
The function returns an array of encode preset guids available for a given codec. The client can directly use one of the preset guids based upon the use case or target device. The preset guid chosen can be directly used in NV_ENC_INITIALIZE_PARAMS::presetGUID parameter to NvEncEncodePicture() API. Alternately client can also use the preset guid to retrieve the encoding config parameters being used by NvEncodeAPI interface for that given preset, using NvEncGetEncodePresetConfig() API. It can then modify preset config parameters as per its use case and send it to NvEncodeAPI interface as part of NV_ENC_INITIALIZE_PARAMS::encodeConfig parameter for NvEncInitializeEncoder() API.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | encodeGUID | Encode GUID, corresponding to which the list of supported presets is to be retrieved. |
[in] | guidArraySize | Size of array of preset guids passed in preset GUIDs |
[out] | presetGUIDs | Array of supported Encode preset GUIDs from the NvEncodeAPI interface to client. |
[out] | encodePresetGUIDCount | Receives the number of preset GUIDs returned by the NvEncodeAPI interface. |
NVENCSTATUS NVENCAPI NvEncGetEncodePresetConfig | ( | void * | encoder, |
GUID | encodeGUID, | ||
GUID | presetGUID, | ||
NV_ENC_PRESET_CONFIG * | presetConfig | ||
) |
Returns a preset config structure supported for given preset GUID.
The function returns a preset config structure for a given preset guid. Before using this function the client must enumerate the preset guids available for a given codec. The preset config structure can be modified by the client depending upon its use case and can be then used to initialize the encoder using NvEncInitializeEncoder() API. The client can use this function only if it wants to modify the NvEncodeAPI preset configuration, otherwise it can directly use the preset guid.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | encodeGUID | Encode GUID, corresponding to which the list of supported presets is to be retrieved. |
[in] | presetGUID | Preset GUID, corresponding to which the Encoding configurations is to be retrieved. |
[out] | presetConfig | The requested Preset Encoder Attribute set. Refer _NV_ENC_CONFIG for more details. |
NVENCSTATUS NVENCAPI NvEncInitializeEncoder | ( | void * | encoder, |
NV_ENC_INITIALIZE_PARAMS * | createEncodeParams | ||
) |
Initialize the encoder.
This API must be used to initialize the encoder. The initialization parameter is passed using *createEncodeParams
The client must send the following fields of the _NV_ENC_INITIALIZE_PARAMS structure with a valid value.
The client can pass a preset guid directly to the NvEncodeAPI interface using NV_ENC_INITIALIZE_PARAMS::presetGUID field. If the client doesn't pass NV_ENC_INITIALIZE_PARAMS::encodeConfig structure, the codec specific parameters will be selected based on the preset guid. The preset guid must have been validated by the client using NvEncGetEncodePresetGUIDs() API. If the client passes a custom _NV_ENC_CONFIG structure through NV_ENC_INITIALIZE_PARAMS::encodeConfig , it will override the codec specific parameters based on the preset guid. It is recommended that even if the client passes a custom config, it should also send a preset guid. In this case, the preset guid passed by the client will not override any of the custom config parameters programmed by the client, it is only used as a hint by the NvEncodeAPI interface to determine certain encoder parameters which are not exposed to the client.
There are two modes of operation for the encoder namely:
The client can select asynchronous or synchronous mode by setting the enableEncodeAsync
field in _NV_ENC_INITIALIZE_PARAMS to 1 or 0 respectively.
NOTE: Asynchronous mode is not supported on Linux.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | createEncodeParams | Refer _NV_ENC_INITIALIZE_PARAMS for details. |
NVENCSTATUS NVENCAPI NvEncCreateInputBuffer | ( | void * | encoder, |
NV_ENC_CREATE_INPUT_BUFFER * | createInputBufferParams | ||
) |
Allocates Input buffer.
This function is used to allocate an input buffer. The client must enumerate the input buffer format before allocating the input buffer resources. The NV_ENC_INPUT_PTR returned by the NvEncodeAPI interface in the NV_ENC_CREATE_INPUT_BUFFER::inputBuffer field can be directly used in NvEncEncodePicture() API. The number of input buffers to be allocated by the client must be at least 4 more than the number of B frames being used for encoding.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | createInputBufferParams | Pointer to the NV_ENC_CREATE_INPUT_BUFFER structure. |
NVENCSTATUS NVENCAPI NvEncDestroyInputBuffer | ( | void * | encoder, |
NV_ENC_INPUT_PTR | inputBuffer | ||
) |
Release an input buffers.
This function is used to free an input buffer. If the client has allocated any input buffer using NvEncCreateInputBuffer() API, it must free those input buffers by calling this function. The client must release the input buffers before destroying the encoder using NvEncDestroyEncoder() API.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | inputBuffer | Pointer to the input buffer to be released. |
NVENCSTATUS NVENCAPI NvEncCreateBitstreamBuffer | ( | void * | encoder, |
NV_ENC_CREATE_BITSTREAM_BUFFER * | createBitstreamBufferParams | ||
) |
Allocates an output bitstream buffer.
This function is used to allocate an output bitstream buffer and returns a NV_ENC_OUTPUT_PTR to bitstream buffer to the client in the NV_ENC_CREATE_BITSTREAM_BUFFER::bitstreamBuffer field. The client can only call this function after the encoder session has been initialized using NvEncInitializeEncoder() API. The minimum number of output buffers allocated by the client must be at least 4 more than the number of B B frames being used for encoding. The client can only access the output bitsteam data by locking the bitstreamBuffer
using the NvEncLockBitstream() function.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | createBitstreamBufferParams | Pointer NV_ENC_CREATE_BITSTREAM_BUFFER for details. |
NVENCSTATUS NVENCAPI NvEncDestroyBitstreamBuffer | ( | void * | encoder, |
NV_ENC_OUTPUT_PTR | bitstreamBuffer | ||
) |
Release a bitstream buffer.
This function is used to release the output bitstream buffer allocated using the NvEncCreateBitstreamBuffer() function. The client must release the output bitstreamBuffer using this function before destroying the encoder session.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | bitstreamBuffer | Pointer to the bitstream buffer being released. |
NVENCSTATUS NVENCAPI NvEncEncodePicture | ( | void * | encoder, |
NV_ENC_PIC_PARAMS * | encodePicParams | ||
) |
Submit an input picture for encoding.
This function is used to submit an input picture buffer for encoding. The encoding parameters are passed using *encodePicParams
which is a pointer to the _NV_ENC_PIC_PARAMS structure.
If the client has set NV_ENC_INITIALIZE_PARAMS::enablePTD to 0, then it must send a valid value for the following fields.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | encodePicParams | Pointer to the _NV_ENC_PIC_PARAMS structure. |
NVENCSTATUS NVENCAPI NvEncLockBitstream | ( | void * | encoder, |
NV_ENC_LOCK_BITSTREAM * | lockBitstreamBufferParams | ||
) |
Lock output bitstream buffer.
This function is used to lock the bitstream buffer to read the encoded data. The client can only access the encoded data by calling this function. The pointer to client accessible encoded data is returned in the NV_ENC_LOCK_BITSTREAM::bitstreamBufferPtr field. The size of the encoded data in the output buffer is returned in the NV_ENC_LOCK_BITSTREAM::bitstreamSizeInBytes The NvEncodeAPI interface also returns the output picture type and picture structure of the encoded frame in NV_ENC_LOCK_BITSTREAM::pictureType and NV_ENC_LOCK_BITSTREAM::pictureStruct fields respectively. If the client has set NV_ENC_LOCK_BITSTREAM::doNotWait to 1, the function might return NV_ENC_ERR_LOCK_BUSY if client is operating in synchronous mode. This is not a fatal failure if NV_ENC_LOCK_BITSTREAM::doNotWait is set to 1. In the above case the client can retry the function after few milliseconds.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | lockBitstreamBufferParams | Pointer to the _NV_ENC_LOCK_BITSTREAM structure. |
NVENCSTATUS NVENCAPI NvEncUnlockBitstream | ( | void * | encoder, |
NV_ENC_OUTPUT_PTR | bitstreamBuffer | ||
) |
Unlock the output bitstream buffer.
This function is used to unlock the output bitstream buffer after the client has read the encoded data from output buffer. The client must call this function to unlock the output buffer which it has previously locked using NvEncLockBitstream() function. Using a locked bitstream buffer in NvEncEncodePicture() API will cause the function to fail.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | bitstreamBuffer | bitstream buffer pointer being unlocked |
NVENCSTATUS NVENCAPI NvEncLockInputBuffer | ( | void * | encoder, |
NV_ENC_LOCK_INPUT_BUFFER * | lockInputBufferParams | ||
) |
Locks an input buffer.
This function is used to lock the input buffer to load the uncompressed YUV pixel data into input buffer memory. The client must pass the NV_ENC_INPUT_PTR it had previously allocated using NvEncCreateInputBuffer()in the NV_ENC_LOCK_INPUT_BUFFER::inputBuffer field. The NvEncodeAPI interface returns pointer to client accessible input buffer memory in NV_ENC_LOCK_INPUT_BUFFER::bufferDataPtr field.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | lockInputBufferParams | Pointer to the _NV_ENC_LOCK_INPUT_BUFFER structure |
NVENCSTATUS NVENCAPI NvEncUnlockInputBuffer | ( | void * | encoder, |
NV_ENC_INPUT_PTR | inputBuffer | ||
) |
Unlocks the input buffer.
This function is used to unlock the input buffer memory previously locked for uploading YUV pixel data. The input buffer must be unlocked before being used again for encoding, otherwise NvEncodeAPI will fail the NvEncEncodePicture()
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | inputBuffer | Pointer to the input buffer that is being unlocked. |
NVENCSTATUS NVENCAPI NvEncGetEncodeStats | ( | void * | encoder, |
NV_ENC_STAT * | encodeStats | ||
) |
Get encoding statistics.
This function is used to retrieve the encoding statistics. This API is not supported when encode device type is CUDA.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | encodeStats | Pointer to the _NV_ENC_STAT structure. |
NVENCSTATUS NVENCAPI NvEncGetSequenceParams | ( | void * | encoder, |
NV_ENC_SEQUENCE_PARAM_PAYLOAD * | sequenceParamPayload | ||
) |
Get encoded sequence and picture header.
This function can be used to retrieve the sequence and picture header out of band. The client must call this function only after the encoder has been initialized using NvEncInitializeEncoder() function. The client must allocate the memory where the NvEncodeAPI interface can copy the bitstream header and pass the pointer to the memory in NV_ENC_SEQUENCE_PARAM_PAYLOAD::spsppsBuffer. The size of buffer is passed in the field NV_ENC_SEQUENCE_PARAM_PAYLOAD::inBufferSize. The NvEncodeAPI interface will copy the bitstream header payload and returns the actual size of the bitstream header in the field NV_ENC_SEQUENCE_PARAM_PAYLOAD::outSPSPPSPayloadSize. The client must call NvEncGetSequenceParams() function from the same thread which is being used to call NvEncEncodePicture() function.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | sequenceParamPayload | Pointer to the _NV_ENC_SEQUENCE_PARAM_PAYLOAD structure. |
NVENCSTATUS NVENCAPI NvEncRegisterAsyncEvent | ( | void * | encoder, |
NV_ENC_EVENT_PARAMS * | eventParams | ||
) |
Register event for notification to encoding completion.
This function is used to register the completion event with NvEncodeAPI interface. The event is required when the client has configured the encoder to work in asynchronous mode. In this mode the client needs to send a completion event with every output buffer. The NvEncodeAPI interface will signal the completion of the encoding process using this event. Only after the event is signalled the client can get the encoded data using NvEncLockBitstream() function.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | eventParams | Pointer to the ::_NV_ENC_EVENT_PARAMS structure. |
NVENCSTATUS NVENCAPI NvEncUnregisterAsyncEvent | ( | void * | encoder, |
NV_ENC_EVENT_PARAMS * | eventParams | ||
) |
Unregister completion event.
This function is used to unregister completion event which has been previously registered using NvEncRegisterAsyncEvent() function. The client must unregister all events before destroying the encoder using NvEncDestroyEncoder() function.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | eventParams | Pointer to the ::_NV_ENC_EVENT_PARAMS structure. |
NVENCSTATUS NVENCAPI NvEncMapInputResource | ( | void * | encoder, |
NV_ENC_MAP_INPUT_RESOURCE * | mapInputResParams | ||
) |
Map an externally created input resource pointer for encoding.
Maps an externally allocated input resource [using and returns a NV_ENC_INPUT_PTR which can be used for encoding in the NvEncEncodePicture() function. The mapped resource is returned in the field NV_ENC_MAP_INPUT_RESOURCE::outputResourcePtr. The NvEncodeAPI interface also returns the buffer format of the mapped resource in the field NV_ENC_MAP_INPUT_RESOURCE::outbufferFmt. This function provides synchronization guarantee that any direct3d or cuda work submitted on the input buffer is completed before the buffer is used for encoding. The client should not access any input buffer while they are mapped by the encoder.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | mapInputResParams | Pointer to the _NV_ENC_MAP_INPUT_RESOURCE structure. |
NVENCSTATUS NVENCAPI NvEncUnmapInputResource | ( | void * | encoder, |
NV_ENC_INPUT_PTR | mappedInputBuffer | ||
) |
UnMaps a NV_ENC_INPUT_PTR which was mapped for encoding.
UnMaps an input buffer which was previously mapped using NvEncMapInputResource() API. The mapping created using NvEncMapInputResource() should be invalidated using this API before the external resource is destroyed by the client. The client must unmap the buffer after NvEncLockBitstream() API returns succuessfully for encode work submitted using the mapped input buffer.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | mappedInputBuffer | Pointer to the NV_ENC_INPUT_PTR |
NVENCSTATUS NVENCAPI NvEncDestroyEncoder | ( | void * | encoder | ) |
Destroy Encoding Session.
Destroys the encoder session previously created using NvEncOpenEncodeSession() function. The client must flush the encoder before freeing any resources. In order to flush the encoder the client must pass a NULL encode picture packet and either wait for the NvEncEncodePicture() function to return in synchronous mode or wait for the flush event to be signaled by the encoder in asynchronous mode. The client must free all the input and output resources created using the NvEncodeAPI interface before destroying the encoder. If the client is operating in asynchronous mode, it must also unregister the completion events previously registered.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
NVENCSTATUS NVENCAPI NvEncInvalidateRefFrames | ( | void * | encoder, |
uint64_t | invalidRefFrameTimeStamp | ||
) |
Invalidate reference frames.
Invalidates reference frame based on the time stamp provided by the client. The encoder marks any reference frames or any frames which have been reconstructed using the corrupt frame as invalid for motion estimation and uses older reference frames for motion estimation. The encoded forces the current frame to be encoded as an intra frame if no reference frames are left after invalidation process. This is useful for low latency application for error resiliency. The client is recommended to set NV_ENC_CONFIG_H264::maxNumRefFrames to a large value so that encoder can keep a backup of older reference frames in the DPB and can use them for motion estimation when the newer reference frames have been invalidated. This API can be called multiple times.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | invalidRefFrameTimeStamp | Timestamp of the invalid reference frames which needs to be invalidated. |
NVENCSTATUS NVENCAPI NvEncOpenEncodeSessionEx | ( | NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS * | openSessionExParams, |
void ** | encoder | ||
) |
Opens an encoding session.
Opens an encoding session and returns a pointer to the encoder interface in the **encoder
parameter. The client should start encoding process by calling this API first. The client must pass a pointer to IDirect3DDevice9/CUDA interface in the *device
parameter. If the creation of encoder session fails, the client must call NvEncDestroyEncoder API before exiting.
[in] | openSessionExParams | Pointer to a NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS structure. |
[out] | encoder | Encode Session pointer to the NvEncodeAPI interface. |
NVENCSTATUS NVENCAPI NvEncRegisterResource | ( | void * | encoder, |
NV_ENC_REGISTER_RESOURCE * | registerResParams | ||
) |
Registers a resource with the Nvidia Video Encoder Interface.
Registers a resource with the Nvidia Video Encoder Interface for book keeping. The client is expected to pass the registered resource handle as well, while calling NvEncMapInputResource API. This API is not implemented for the DirectX Interface. DirectX based clients need not change their implementation.
[in] | encoder | Pointer to the NVEncodeAPI interface. |
[in] | registerResParams | Pointer to a _NV_ENC_REGISTER_RESOURCE structure |
NVENCSTATUS NVENCAPI NvEncUnregisterResource | ( | void * | encoder, |
NV_ENC_REGISTERED_PTR | registeredResource | ||
) |
Unregisters a resource previously registered with the Nvidia Video Encoder Interface.
Unregisters a resource previously registered with the Nvidia Video Encoder Interface. The client is expected to unregister any resource that it has registered with the Nvidia Video Encoder Interface before destroying the resource. This API is not implemented for the DirectX Interface. DirectX based clients need not change their implementation.
[in] | encoder | Pointer to the NVEncodeAPI interface. |
[in] | registeredResource | The registered resource pointer that was returned in NvEncRegisterResource. |
NVENCSTATUS NVENCAPI NvEncReconfigureEncoder | ( | void * | encoder, |
NV_ENC_RECONFIGURE_PARAMS * | reInitEncodeParams | ||
) |
Reconfigure an existing encoding session.
Reconfigure an existing encoding session. The client should call this API to change/reconfigure the parameter passed during NvEncInitializeEncoder API call. Currently Reconfiguration of following are not supported. Change in GOP structure. Change in sync-Async mode. Change in MaxWidth & MaxHeight. Change in PTDmode.
Resolution change is possible only if maxEncodeWidth & maxEncodeHeight of NV_ENC_INITIALIZE_PARAMS is set while creating encoder session.
[in] | encoder | Pointer to the NVEncodeAPI interface. |
[in] | reInitEncodeParams | Pointer to a NV_ENC_RECONFIGURE_PARAMS structure. |
NVENCSTATUS NVENCAPI NvEncCreateMVBuffer | ( | void * | encoder, |
NV_ENC_CREATE_MV_BUFFER * | createMVBufferParams | ||
) |
Allocates output MV buffer for ME only mode.
This function is used to allocate an output MV buffer. The size of the mvBuffer is dependent on the frame height and width of the last NvEncCreateInputBuffer() call. The NV_ENC_OUTPUT_PTR returned by the NvEncodeAPI interface in the NV_ENC_CREATE_MV_BUFFER::mvBuffer field should be used in NvEncRunMotionEstimationOnly() API. Client must lock NV_ENC_CREATE_MV_BUFFER::mvBuffer using NvEncLockBitstream() API to get the motion vector data.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in,out] | createMVBufferParams | Pointer to the NV_ENC_CREATE_MV_BUFFER structure. |
NVENCSTATUS NVENCAPI NvEncDestroyMVBuffer | ( | void * | encoder, |
NV_ENC_OUTPUT_PTR | mvBuffer | ||
) |
Release an output MV buffer for ME only mode.
This function is used to release the output MV buffer allocated using the NvEncCreateMVBuffer() function. The client must release the output mvBuffer using this function before destroying the encoder session.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | mvBuffer | Pointer to the mvBuffer being released. |
NVENCSTATUS NVENCAPI NvEncRunMotionEstimationOnly | ( | void * | encoder, |
NV_ENC_MEONLY_PARAMS * | meOnlyParams | ||
) |
Submit an input picture and reference frame for motion estimation in ME only mode.
This function is used to submit the input frame and reference frame for motion estimation. The ME parameters are passed using *meOnlyParams which is a pointer to _NV_ENC_MEONLY_PARAMS structure. Client must lock NV_ENC_CREATE_MV_BUFFER::mvBuffer using NvEncLockBitstream() API to get the motion vector data. to get motion vector data.
[in] | encoder | Pointer to the NvEncodeAPI interface. |
[in] | meOnlyParams | Pointer to the _NV_ENC_MEONLY_PARAMS structure. |
NVENCSTATUS NVENCAPI NvEncodeAPIGetMaxSupportedVersion | ( | uint32_t * | version | ) |
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.
[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. |
NVENCSTATUS NVENCAPI NvEncodeAPICreateInstance | ( | NV_ENCODE_API_FUNCTION_LIST * | functionList | ) |
Entry Point to the NvEncodeAPI interface.
Creates an instance of the NvEncodeAPI interface, and populates the pFunctionList with function pointers to the API routines implemented by the NvEncodeAPI interface.
[out] | functionList |