MTEncode API Reference
Functions
Function MTEncCreateEncoder
MTENCSTATUS MTENCAPI MTEncCreateEncoder(MT_ENC_CREATE_ENCODER_PARAMS *createEncoderParams, void **encoder)
Creates an encoder.
Creates an encoder and returns a pointer to the encoder interface in the encoder parameter. The client should start the encoding process by calling this function first. The client must pass a pointer to the device in the *device parameter. If the creation of encoder fails, the client must call MTEncReleaseEncoder() before exiting.
Parameters:
createEncoderParams: A pointer to MT_ENC_CREATE_ENCODER_PARAMS.encoder: The encoder pointer to the MTEncodeAPI interface.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_UNSUPPORTED_DEVICE
MT_ENC_ERR_GENERIC
Function MTEncGetPresetConfig
MTENCSTATUS MTENCAPI MTEncGetPresetConfig(void *encoder, MT_ENC_CODEC_ID encodeID, MT_ENC_PRESET_ID presetID, MT_ENC_PRESET_CONFIG *presetConfig)
Returns a preset configuration structure supported for a given preset ID.
The preset configuration structure can be modified by the client depending on its use case and then used to initialize the encoder using MTEncInitEncoder().
Parameters:
encoder: A pointer to the MTEncodeAPI interface.encodeID: The encode ID, corresponding to which the supported presets are to be retrieved.presetID: The preset ID, corresponding to which the encoding configurations are to be retrieved.presetConfig: The requested preset encoder attribute set. For more information, see _MT_ENC_CONFIG.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_GENERIC
Function MTEncInitEncoder
MTENCSTATUS MTENCAPI MTEncInitEncoder(void *encoder, MT_ENC_INIT_PARAMS *initParams)
Initializes the encoder.
This function must be used to initialize the encoder. The initialization parameters are passed using *initParams. The client must send the following fields of the _MT_ENC_INIT_PARAMS structure with a valid value.
The client can pass a preset ID directly to the MTEncodeAPI interface using MT_ENC_INIT_PARAMS::presetID. If the client does not pass MT_ENC_INIT_PARAMS::encodeConfig, the codec-specific parameters will be selected based on the preset ID. If the client passes a custom _MT_ENC_CONFIG structure through MT_ENC_INIT_PARAMS::encodeConfig, it will override the codec-specific parameters based on the preset ID. It is recommended that even if the client passes a custom configuration, it should also send a preset ID. In this case, the preset ID passed by the client will not override any of the custom configuration parameters programmed by the client, it is only used as a hint by the MTEncodeAPI interface to determine certain encoder parameters which are not exposed to the client.
The encoder supports the following operation modes:
-
The asynchronous mode
-
The synchronous mode
The client can select asynchronous or synchronous mode by setting enableEncodeAsync in _MT_ENC_INIT_PARAMS to 1 or 0 respectively.
Asynchronous mode of operation:
The asynchronous mode can be enabled by setting MT_ENC_INIT_PARAMS::enableEncodeAsync to 1. The client operating in the asynchronous mode must allocate a completion event object for each output buffer and pass the completion event object in the MTEncEncodeFrame() function. The client can create another thread and wait on the event object to be signalled by the MTEncodeAPI interface on completion of the encoding process for the output frame. This should unblock the main thread from submitting work to the encoder. When the event is signalled, the client can call MTEncodeAPI interfaces to copy the bitstream data using the MTEncLockOutputBuffer() function. This is the preferred mode of operation.
NOTE: Asynchronous mode is not supported on Linux.
Synchronous mode of operation:
The client can select the synchronous mode by setting MT_ENC_INIT_PARAMS::enableEncodeAsync to 0. The client working in the synchronous mode can work in a single-threaded or multithreaded mode. The client does not need to allocate any event objects. The client can only lock the bitstream data after the MTEncodeAPI interface has returned MT_ENC_SUCCESS from encoding pictures. MTEncodeAPI can return the MT_ENC_ERR_NEED_MORE_INPUT error code from MTEncEncodeFrame(). The client must not lock the output buffer in such a case but should send the next frame for encoding. The client must keep on calling MTEncEncodeFrame() until it returns MT_ENC_SUCCESS.
The client must always lock the bitstream data in the order in which it has been submitted.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.initParams: For more information, see _MT_ENC_INIT_PARAMS.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_GENERIC
Function MTEncReconfigureEncoder
MTENCSTATUS MTENCAPI MTEncReconfigureEncoder(void *encoder, MT_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 MTEncInitializeEncoder API call. Currently Reconfiguration of following are supported. Change in bitrate. Change in fps.
Parameters:
encoder: Pointer to the MTEncodeAPI interface.reInitEncodeParams: Pointer to a MT_ENC_RECONFIGURE_PARAMS structure.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_GENERIC
Function MTEncCreateOutputBuffer
MTENCSTATUS MTENCAPI MTEncCreateOutputBuffer(void *encoder, MT_ENC_CREATE_OUTPUT_BUFFER *createOutputBufferParams)
Allocates an output bitstream buffer.
This function is used to allocate an output bitstream buffer and returns a MT_ENC_OUTPUT_PTR to bitstream buffer to the client in MT_ENC_CREATE_OUTPUT_BUFFER::outputBuffer. The client can only call this function after the encoder has been initialized using MTEncInitEncoder(). The minimum number of output buffers allocated by the client must be at least (2 * _MT_ENC_CONFIG::frameIntervalP + 1). The client can only access the output bitsteam data by locking outputBuffer using MTEncLockOutputBuffer().
Parameters:
encoder: A pointer to the MTEncodeAPI interface.createOutputBufferParams: A pointer to MT_ENC_CREATE_OUTPUT_BUFFER.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_GENERIC
Function MTEncReleaseOutputBuffer
MTENCSTATUS MTENCAPI MTEncReleaseOutputBuffer(void *encoder, MT_ENC_OUTPUT_PTR outputBuffer)
Releases an output buffer.
This function is used to release the output bitstream buffer allocated using MTEncCreateOutputBuffer(). The client must release the output bitstream buffer using this function before destroying the encoder.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.outputBuffer: A pointer to the bitstream buffer being released.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_GENERIC
Function MTEncEncodeFrame
MTENCSTATUS MTENCAPI MTEncEncodeFrame(void *encoder, MT_ENC_PIC_PARAMS *encodePicParams)
Submits 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 _MT_ENC_PIC_PARAMS.
The MTEncodeAPI interface might return the MT_ENC_ERR_NEED_MORE_INPUT error code but the client must not treat it as a fatal error. The MTEncodeAPI interface might not be able to submit an input picture buffer for encoding immediately due to re-ordering for B-frames. The MTEncodeAPI interface cannot submit the input picture which is decided to be encoded as a B-frame as it waits for backward reference from temporally subsequent frames. This input picture is buffered internally and waits for more input pictures to arrive. The client must not call MTEncLockOutputBuffer() on the output buffers whose MTEncEncodeFrame() returns MT_ENC_ERR_NEED_MORE_INPUT. The client must wait for the MTEncodeAPI interface to return MT_ENC_SUCCESS before locking the output buffer to read the encoded bitstream data.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.encodePicParams: A pointer to the _MT_ENC_PIC_PARAMS structure.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_ENCODER_BUSY
MT_ENC_ERR_NEED_MORE_INPUT
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_GENERIC
Function MTEncEncodeDesktop
MTENCSTATUS MTENCAPI MTEncEncodeDesktop(void *encoder, MT_ENC_DESKTOP_PARAMS *encodeDesktopParams)
Submits a request for encoding current desktop.
This function is used to submit a request for encoding current desktop. The encoding parameters are passed using *encodePicParams which is a pointer to _MT_ENC_PIC_PARAMS.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.encodeDesktopParams: A pointer to the MT_ENC_DESKTOP_PARAMS structure.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_ENCODER_BUSY
MT_ENC_ERR_NEED_MORE_INPUT
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_GENERIC
Function MTEncBeginDesktopCapture
MTENCSTATUS MTENCAPI MTEncBeginDesktopCapture(void *encoder, MT_ENC_CAPTURE_DESKTOP_PARAMS *captureDesktopParams)
Initializes desktop capture session.
This function is used to initialize a desktop capture session. This function is paired with MTEncEndDesktopCapture.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.captureDesktopParams: A pointer to the MT_ENC_CAPTURE_DESKTOP_PARAMS structure.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_INVALID_DESKTOP_ID
MT_ENC_ERR_TIMEOUT
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_GENERIC
Function MTEncEndDesktopCapture
MTENCSTATUS MTENCAPI MTEncEndDesktopCapture(void *encoder, MT_ENC_INPUT_PTR capturedBuffer)
Releases desktop capture session.
This function is used to release the desktop capture session initialized with MTEncBeginDesktopCapture. This function must be called after completing the desktop capture and encoding process. This function is paired with MTEncBeginDesktopCapture.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.capturedBuffer:MT_ENC_INPUT_PTR
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_GENERIC
Function MTEncLockOutputBuffer
MTENCSTATUS MTENCAPI MTEncLockOutputBuffer(void *encoder, MT_ENC_LOCK_BUFFER *lockOutputBufferParams)
Locks output buffer.
This function is used to lock the buffer to read the encoded data. The client can only access the encoded data by calling this function. A pointer to client accessible encoded data is returned in the MT_ENC_LOCK_BUFFER::outputBufferPtr field. The size of the encoded data in the output buffer is returned in MT_ENC_LOCK_BUFFER::outputBufferSizeInBytes. The MTEncodeAPI interface also returns the output picture type of the encoded frame in MT_ENC_LOCK_BUFFER::pictureType.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.lockOutputBufferParams: A pointer to the _MT_ENC_LOCK_BUFFER structure.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_GENERIC
Function MTEncUnlockOutputBuffer
MTENCSTATUS MTENCAPI MTEncUnlockOutputBuffer(void *encoder, MT_ENC_OUTPUT_PTR outputBuffer)
Unlocks the output buffer.
This function is used to unlock the output buffer after the client has read the encoded data from the output buffer. The client must call this function to unlock the output buffer which it has previously locked using MTEncLockOutputBuffer() . Using a locked buffer in MTEncEncodeFrame() will cause the function to fail.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.outputBuffer: The bitstream buffer pointer that is being unlocked.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_GENERIC
Function MTEncMapResource
MTENCSTATUS MTENCAPI MTEncMapResource(void *encoder, MT_ENC_MAP_RESOURCE *mapInputResParams)
Maps an externally created input resource pointer for encoding.
Maps an externally allocated input resource using and returns an MT_ENC_INPUT_PTR which can be used for encoding in MTEncEncodeFrame(). The mapped resource is returned in MT_ENC_MAP_RESOURCE::mappedResource. This function provides synchronization guarantee that any graphics or compute 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 being mapped by the encoder.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.mapInputResParams: A pointer to _MT_ENC_MAP_RESOURCE.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_MAP_FAILED
MT_ENC_ERR_GENERIC
Function MTEncUnmapResource
MTENCSTATUS MTENCAPI MTEncUnmapResource(void *encoder, MT_ENC_INPUT_PTR mappedInputBuffer)
Unmaps an MT_ENC_INPUT_PTR which was mapped for encoding.
Unmaps an input buffer that was previously mapped using MTEncMapResource(). The mapping created using MTEncMapResource() should be invalidated using this function before the external resource is destroyed by the client. The client must unmap the buffer after MTEncLockOutputBuffer() returns successfully for encode work submitted using the mapped input buffer.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.mappedInputBuffer: A pointer to MT_ENC_INPUT_PTR.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_INVALID_VERSION
MT_ENC_ERR_ENCODER_NOT_INITIALIZED
MT_ENC_ERR_RESOURCE_NOT_MAPPED
MT_ENC_ERR_GENERIC
Function MTEncReleaseEncoder
MTENCSTATUS MTENCAPI MTEncReleaseEncoder(void *encoder)
Releases an encoder.
Releases the encoder previously created using MTEncCreateEncoder(). The client must flush the encoder before freeing any resources. To flush the encoder, the client must pass a NULL encode picture packet and either wait for MTEncEncodeFrame() to return in the synchronous mode. The client must free all the input and output resources created using MTEncodeAPI before releasing the encoder.
Parameters:
encoder: A pointer to the MTEncodeAPI interface.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_NO_ENCODE_DEVICE
MT_ENC_ERR_OUT_OF_MEMORY
MT_ENC_ERR_GENERIC
Function MTEncGetCaps
MTENCSTATUS MTENCAPI MTEncGetCaps(void *encoder, MT_ENC_CODEC_ID encodeID, MT_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 encoder attributes being queried are enumerated in MT_ENC_CAPS_PARAM fields.
Parameters:
encoder: Pointer to the MTEncodeAPI interface.encodeID: Encode ID, corresponding to which the capability attribute is to be retrieved.capsParam: Used to specify attribute being queried. Refer MT_ENC_CAPS_PARAM for more details.capsVal: The value corresponding to the capability attribute being queried.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_GENERIC
Function MTEncGetSequenceParams
MTENCSTATUS MTENCAPI MTEncGetSequenceParams(void *encoder, MT_ENC_SEQUENCE_PARAM_PAYLOAD *seqPayload)
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 MTEncInitEncoder() function. The client must allocate the memory where the MtEncodeAPI interface can copy the bitstream header and pass the pointer to the memory in MT_ENC_SEQUENCE_PARAM_PAYLOAD::spsppsBuffer. The size of buffer is passed in the field MT_ENC_SEQUENCE_PARAM_PAYLOAD::inBufferSize. The MtEncodeAPI interface will copy the bitstream header payload and returns the actual size of the bitstream header in the field MT_ENC_SEQUENCE_PARAM_PAYLOAD::outSPSPPSPayloadSize.
Parameters:
encoder: Pointer to the MtEncodeAPI interface.seqPayload:MT_ENC_SEQUENCE_PARAM_PAYLOAD *
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
MT_ENC_ERR_GENERIC
Function MTEncodeAPIGetMaxSupportedVersion
MTENCSTATUS MTENCAPI MTEncodeAPIGetMaxSupportedVersion(uint32_t *version)
Gets the latest MTEncodeAPI version supported by the driver.
This function can be used by clients to determine if the driver supports the MTEncodeAPI header that the application was compiled with.
Parameters:
version: A pointer to the requested value. The 4 least significant bits in the returned value indicate the minor version and the rest of the bits indicate the major version of the latest supported version.
Returns:
MT_ENC_SUCCESS
MT_ENC_ERR_INVALID_PARAM
Function MTEncodeAPICreateInstance
MTENCSTATUS MTENCAPI MTEncodeAPICreateInstance(MT_ENCODE_API_FUNCTION_LIST *functionList)
The entry point to the MTEncodeAPI interface.
Creates an instance of the MTEncodeAPI interface, and populates the functionList with function pointers to the API routines implemented by MTEncodeAPI.
Parameters:
functionList: A pointer toMT_ENCODE_API_FUNCTION_LIST.
Returns:
MT_ENC_SUCCESSMT_ENC_ERR_INVALID_PARAMMT_ENC_ERR_INVALID_VERSION
MTEncodeAPI data structures
Enumeration types
Enumeration type _MT_ENC_CODEC_ID
Definition: mtEncodeAPI.h (line 120)
enum _MT_ENC_CODEC_ID {
MT_ENC_CODEC_ID_H264 = 0x1,
MT_ENC_CODEC_ID_HEVC = 0x2,
MT_ENC_CODEC_ID_AV1 = 0x3
}
Codec IDs supported by the MTEncodeAPI interface.
Enumerator MT_ENC_CODEC_ID_H264
The H.264 codec ID.
Enumerator MT_ENC_CODEC_ID_HEVC
The HEVC codec ID.
Enumerator MT_ENC_CODEC_ID_AV1
The AV1 codec ID. Need libva >= 2.16 on Linux
Enumeration type _MT_ENC_CODEC_PROFILE_ID
Definition: mtEncodeAPI.h (line 130)
enum _MT_ENC_CODEC_PROFILE_ID {
MT_ENC_CODEC_PROFILE_ID_AUTOSELECT = 0x1,
MT_ENC_CODEC_PROFILE_ID_BASELINE_H264 = 0x2,
MT_ENC_CODEC_PROFILE_ID_MAIN_H264 = 0x3,
MT_ENC_CODEC_PROFILE_ID_HIGH_H264 = 0x4,
MT_ENC_CODEC_PROFILE_ID_HIGH10_H264 = 0x5,
MT_ENC_CODEC_PROFILE_ID_MAIN_HEVC = 0x10,
MT_ENC_CODEC_PROFILE_ID_MAIN_10_HEVC = 0x11,
MT_ENC_CODEC_PROFILE_ID_MAIN_AV1 = 0x20
}
Profile IDs supported by the MTEncodeAPI interface.
Enumerator MT_ENC_CODEC_PROFILE_ID_AUTOSELECT
Enumerator MT_ENC_CODEC_PROFILE_ID_BASELINE_H264
Enumerator MT_ENC_CODEC_PROFILE_ID_MAIN_H264
Enumerator MT_ENC_CODEC_PROFILE_ID_HIGH_H264
Enumerator MT_ENC_CODEC_PROFILE_ID_HIGH10_H264
Enumerator MT_ENC_CODEC_PROFILE_ID_MAIN_HEVC
Enumerator MT_ENC_CODEC_PROFILE_ID_MAIN_10_HEVC
Enumerator MT_ENC_CODEC_PROFILE_ID_MAIN_AV1
Enumeration type _MT_ENC_PRESET_ID
Definition: mtEncodeAPI.h (line 148)
enum _MT_ENC_PRESET_ID {
MT_ENC_PRESET_ID_DEFAULT = 0x1
}
Preset IDs supported by the MTEncodeAPI interface.
Enumerator MT_ENC_PRESET_ID_DEFAULT
The default preset ID.
Enumeration type _MT_ENC_PARAMS_RC_MODE
Definition: mtEncodeAPI.h (line 156)
enum _MT_ENC_PARAMS_RC_MODE {
MT_ENC_PARAMS_RC_CONSTQP = 0x0,
MT_ENC_PARAMS_RC_CBR = 0x1,
MT_ENC_PARAMS_RC_VBR = 0x2
}
Rate control (RC) modes.
Enumerator MT_ENC_PARAMS_RC_CONSTQP
The constant QP mode.
Enumerator MT_ENC_PARAMS_RC_CBR
The constant bit rate (CBR) mode.
Enumerator MT_ENC_PARAMS_RC_VBR
The variable bit rate (VBR) mode.
Enumeration type _MT_ENC_PIC_TYPE
Definition: mtEncodeAPI.h (line 166)
enum _MT_ENC_PIC_TYPE {
MT_ENC_PIC_TYPE_I = 0x0,
MT_ENC_PIC_TYPE_P = 0x1,
MT_ENC_PIC_TYPE_B = 0x2,
MT_ENC_PIC_TYPE_IDR = 0x3,
MT_ENC_PIC_TYPE_UNKNOWN = 0xFF
}
Input picture types.
Enumerator MT_ENC_PIC_TYPE_I
An intra-predicted picture.
Enumerator MT_ENC_PIC_TYPE_P
A forward-predicted picture.
Enumerator MT_ENC_PIC_TYPE_B
A bi-directionally predicted picture.
Enumerator MT_ENC_PIC_TYPE_IDR
An instantaneous decoding refresh (IDR) picture.
Enumerator MT_ENC_PIC_TYPE_UNKNOWN
An unknown type.
Enumeration type _MT_ENC_BUFFER_FORMAT
Definition: mtEncodeAPI.h (line 178)
enum _MT_ENC_BUFFER_FORMAT {
MT_ENC_BUFFER_FORMAT_UNDEFINED = 0x00000000,
MT_ENC_BUFFER_FORMAT_NV12 = 0x00000001,
MT_ENC_BUFFER_FORMAT_BGRA = 0x10000000,
MT_ENC_BUFFER_FORMAT_RGBA = 0x01000000,
MT_ENC_BUFFER_FORMAT_P010_LE = 0x00010000,
MT_ENC_BUFFER_FORMAT_RGBAF16_LE = 0x00001000
}
Input buffer formats.
Enumerator MT_ENC_BUFFER_FORMAT_UNDEFINED
The undefined buffer format.
Enumerator MT_ENC_BUFFER_FORMAT_NV12
Semi-planar YUV. The Y plane is followed by the interleaved UV plane.
Enumerator MT_ENC_BUFFER_FORMAT_BGRA
8-bit packed pixel format in byte order: B, G, R, A (one byte per channel).
Enumerator MT_ENC_BUFFER_FORMAT_RGBA
8-bit packed pixel format in byte order: R, G, B, A (one byte per channel).
Enumerator MT_ENC_BUFFER_FORMAT_P010_LE
Like NV12, with 10 bits per pixel (bpp) per component, data in the high bits, zeros in the low bits, little-endian.
Enumerator MT_ENC_BUFFER_FORMAT_RGBAF16_LE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp. A four-component, 64-bit floating-point format that supports 16 bits per channel including alpha. Can only be used with Windows now.
Enumeration type _MT_ENC_BUFFER_TYPE
Definition: mtEncodeAPI.h (line 191)
enum _MT_ENC_BUFFER_TYPE {
MT_ENC_BUFFER_TYPE_SYSTEM_MEMORY = 0x0,
MT_ENC_BUFFER_TYPE_FD = 0x1
}
Input buffer types. Used only on Linux.
Enumerator MT_ENC_BUFFER_TYPE_SYSTEM_MEMORY
The buffer is system memory.
Enumerator MT_ENC_BUFFER_TYPE_FD
The buffer is fd handle.
Enumeration type _MT_ENC_LEVEL
Definition: mtEncodeAPI.h (line 200)
enum _MT_ENC_LEVEL {
MT_ENC_LEVEL_AUTOSELECT = 0x0,
MT_ENC_LEVEL_H264_1 = 10,
MT_ENC_LEVEL_H264_11 = 11,
MT_ENC_LEVEL_H264_12 = 12,
MT_ENC_LEVEL_H264_13 = 13,
MT_ENC_LEVEL_H264_2 = 20,
MT_ENC_LEVEL_H264_21 = 21,
MT_ENC_LEVEL_H264_22 = 22,
MT_ENC_LEVEL_H264_3 = 30,
MT_ENC_LEVEL_H264_31 = 31,
MT_ENC_LEVEL_H264_32 = 32,
MT_ENC_LEVEL_H264_4 = 40,
MT_ENC_LEVEL_H264_41 = 41,
MT_ENC_LEVEL_H264_42 = 42,
MT_ENC_LEVEL_H264_5 = 50,
MT_ENC_LEVEL_H264_51 = 51,
MT_ENC_LEVEL_H264_52 = 52,
MT_ENC_LEVEL_HEVC_1 = 30,
MT_ENC_LEVEL_HEVC_2 = 60,
MT_ENC_LEVEL_HEVC_21 = 63,
MT_ENC_LEVEL_HEVC_3 = 90,
MT_ENC_LEVEL_HEVC_31 = 93,
MT_ENC_LEVEL_HEVC_4 = 120,
MT_ENC_LEVEL_HEVC_41 = 123,
MT_ENC_LEVEL_HEVC_5 = 150,
MT_ENC_LEVEL_HEVC_51 = 153,
MT_ENC_LEVEL_HEVC_52 = 156,
MT_ENC_LEVEL_HEVC_6 = 180,
MT_ENC_LEVEL_HEVC_61 = 183,
MT_ENC_LEVEL_HEVC_62 = 186,
MT_ENC_TIER_HEVC_MAIN = 0,
MT_ENC_TIER_HEVC_HIGH = 1,
MT_ENC_LEVEL_AV1_2 = 0,
MT_ENC_LEVEL_AV1_21 = 1,
MT_ENC_LEVEL_AV1_22 = 2,
MT_ENC_LEVEL_AV1_23 = 3,
MT_ENC_LEVEL_AV1_3 = 4,
MT_ENC_LEVEL_AV1_31 = 5,
MT_ENC_LEVEL_AV1_32 = 6,
MT_ENC_LEVEL_AV1_33 = 7,
MT_ENC_LEVEL_AV1_4 = 8,
MT_ENC_LEVEL_AV1_41 = 9,
MT_ENC_LEVEL_AV1_42 = 10,
MT_ENC_LEVEL_AV1_43 = 11,
MT_ENC_LEVEL_AV1_5 = 12,
MT_ENC_LEVEL_AV1_51 = 13,
MT_ENC_LEVEL_AV1_52 = 14,
MT_ENC_LEVEL_AV1_53 = 15,
MT_ENC_LEVEL_AV1_6 = 16,
MT_ENC_LEVEL_AV1_61 = 17,
MT_ENC_LEVEL_AV1_62 = 18,
MT_ENC_LEVEL_AV1_63 = 19,
MT_ENC_LEVEL_AV1_7 = 20,
MT_ENC_LEVEL_AV1_71 = 21,
MT_ENC_LEVEL_AV1_72 = 22,
MT_ENC_LEVEL_AV1_73 = 23,
MT_ENC_LEVEL_AV1_AUTOSELECT,
MT_ENC_TIER_AV1_0 = 0,
MT_ENC_TIER_AV1_1 = 1
}
Encoding levels.
Enumerator MT_ENC_LEVEL_AUTOSELECT
Enumerator MT_ENC_LEVEL_H264_1
Enumerator MT_ENC_LEVEL_H264_11
Enumerator MT_ENC_LEVEL_H264_12
Enumerator MT_ENC_LEVEL_H264_13
Enumerator MT_ENC_LEVEL_H264_2
Enumerator MT_ENC_LEVEL_H264_21
Enumerator MT_ENC_LEVEL_H264_22
Enumerator MT_ENC_LEVEL_H264_3
Enumerator MT_ENC_LEVEL_H264_31
Enumerator MT_ENC_LEVEL_H264_32
Enumerator MT_ENC_LEVEL_H264_4
Enumerator MT_ENC_LEVEL_H264_41
Enumerator MT_ENC_LEVEL_H264_42
Enumerator MT_ENC_LEVEL_H264_5
Enumerator MT_ENC_LEVEL_H264_51
Enumerator MT_ENC_LEVEL_H264_52
Enumerator MT_ENC_LEVEL_HEVC_1
Enumerator MT_ENC_LEVEL_HEVC_2
Enumerator MT_ENC_LEVEL_HEVC_21
Enumerator MT_ENC_LEVEL_HEVC_3
Enumerator MT_ENC_LEVEL_HEVC_31
Enumerator MT_ENC_LEVEL_HEVC_4
Enumerator MT_ENC_LEVEL_HEVC_41
Enumerator MT_ENC_LEVEL_HEVC_5
Enumerator MT_ENC_LEVEL_HEVC_51
Enumerator MT_ENC_LEVEL_HEVC_52
Enumerator MT_ENC_LEVEL_HEVC_6
Enumerator MT_ENC_LEVEL_HEVC_61
Enumerator MT_ENC_LEVEL_HEVC_62
Enumerator MT_ENC_TIER_HEVC_MAIN
Enumerator MT_ENC_TIER_HEVC_HIGH
Enumerator MT_ENC_LEVEL_AV1_2
Enumerator MT_ENC_LEVEL_AV1_21
Enumerator MT_ENC_LEVEL_AV1_22
Enumerator MT_ENC_LEVEL_AV1_23
Enumerator MT_ENC_LEVEL_AV1_3
Enumerator MT_ENC_LEVEL_AV1_31
Enumerator MT_ENC_LEVEL_AV1_32
Enumerator MT_ENC_LEVEL_AV1_33
Enumerator MT_ENC_LEVEL_AV1_4
Enumerator MT_ENC_LEVEL_AV1_41
Enumerator MT_ENC_LEVEL_AV1_42
Enumerator MT_ENC_LEVEL_AV1_43
Enumerator MT_ENC_LEVEL_AV1_5
Enumerator MT_ENC_LEVEL_AV1_51
Enumerator MT_ENC_LEVEL_AV1_52
Enumerator MT_ENC_LEVEL_AV1_53
Enumerator MT_ENC_LEVEL_AV1_6
Enumerator MT_ENC_LEVEL_AV1_61
Enumerator MT_ENC_LEVEL_AV1_62
Enumerator MT_ENC_LEVEL_AV1_63
Enumerator MT_ENC_LEVEL_AV1_7
Enumerator MT_ENC_LEVEL_AV1_71
Enumerator MT_ENC_LEVEL_AV1_72
Enumerator MT_ENC_LEVEL_AV1_73
Enumerator MT_ENC_LEVEL_AV1_AUTOSELECT
Enumerator MT_ENC_TIER_AV1_0
Enumerator MT_ENC_TIER_AV1_1
Enumeration type _MT_ENC_VUI_VIDEO_FORMAT
Definition: mtEncodeAPI.h (line 272)
enum _MT_ENC_VUI_VIDEO_FORMAT {
MT_ENC_VUI_VIDEO_FORMAT_COMPONENT = 0,
MT_ENC_VUI_VIDEO_FORMAT_PAL = 1,
MT_ENC_VUI_VIDEO_FORMAT_NTSC = 2,
MT_ENC_VUI_VIDEO_FORMAT_SECAM = 3,
MT_ENC_VUI_VIDEO_FORMAT_MAC = 4,
MT_ENC_VUI_VIDEO_FORMAT_UNSPECIFIED = 5
}
Enums related to fields in VUI parameters.
Enumerator MT_ENC_VUI_VIDEO_FORMAT_COMPONENT
Enumerator MT_ENC_VUI_VIDEO_FORMAT_PAL
Enumerator MT_ENC_VUI_VIDEO_FORMAT_NTSC
Enumerator MT_ENC_VUI_VIDEO_FORMAT_SECAM
Enumerator MT_ENC_VUI_VIDEO_FORMAT_MAC
Enumerator MT_ENC_VUI_VIDEO_FORMAT_UNSPECIFIED
Enumeration type _MT_ENC_VUI_COLOR_PRIMARIES
Definition: mtEncodeAPI.h (line 282)
enum _MT_ENC_VUI_COLOR_PRIMARIES {
MT_ENC_VUI_COLOR_PRIMARIES_UNDEFINED = 0,
MT_ENC_VUI_COLOR_PRIMARIES_BT709 = 1,
MT_ENC_VUI_COLOR_PRIMARIES_UNSPECIFIED = 2,
MT_ENC_VUI_COLOR_PRIMARIES_RESERVED = 3,
MT_ENC_VUI_COLOR_PRIMARIES_BT470M = 4,
MT_ENC_VUI_COLOR_PRIMARIES_BT470BG = 5,
MT_ENC_VUI_COLOR_PRIMARIES_SMPTE170M = 6,
MT_ENC_VUI_COLOR_PRIMARIES_SMPTE240M = 7,
MT_ENC_VUI_COLOR_PRIMARIES_FILM = 8,
MT_ENC_VUI_COLOR_PRIMARIES_BT2020 = 9,
MT_ENC_VUI_COLOR_PRIMARIES_SMPTE428 = 10,
MT_ENC_VUI_COLOR_PRIMARIES_SMPTE431 = 11,
MT_ENC_VUI_COLOR_PRIMARIES_SMPTE432 = 12,
MT_ENC_VUI_COLOR_PRIMARIES_JEDEC_P22 = 22
}
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_UNDEFINED
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_BT709
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_UNSPECIFIED
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_RESERVED
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_BT470M
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_BT470BG
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_SMPTE170M
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_SMPTE240M
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_FILM
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_BT2020
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_SMPTE428
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_SMPTE431
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_SMPTE432
Enumerator MT_ENC_VUI_COLOR_PRIMARIES_JEDEC_P22
Enumeration type _MT_ENC_VUI_TRANSFER_CHARACTERISTIC
Definition: mtEncodeAPI.h (line 300)
enum _MT_ENC_VUI_TRANSFER_CHARACTERISTIC {
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_UNDEFINED = 0,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT709 = 1,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_RESERVED = 3,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT470M = 4,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT470BG = 5,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE170M = 6,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE240M = 7,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_LINEAR = 8,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_LOG = 9,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_LOG_SQRT = 10,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_IEC61966_2_4 = 11,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT1361_ECG = 12,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SRGB = 13,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT2020_10 = 14,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT2020_12 = 15,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE2084 = 16,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE428 = 17,
MT_ENC_VUI_TRANSFER_CHARACTERISTIC_ARIB_STD_B67 = 18
}
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_UNDEFINED
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT709
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_UNSPECIFIED
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_RESERVED
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT470M
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT470BG
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE170M
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE240M
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_LINEAR
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_LOG
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_LOG_SQRT
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_IEC61966_2_4
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT1361_ECG
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SRGB
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT2020_10
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_BT2020_12
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE2084
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE428
Enumerator MT_ENC_VUI_TRANSFER_CHARACTERISTIC_ARIB_STD_B67
Enumeration type _MT_ENC_VUI_MATRIX_COEFFS
Definition: mtEncodeAPI.h (line 323)
enum _MT_ENC_VUI_MATRIX_COEFFS {
MT_ENC_VUI_MATRIX_COEFFS_RGB = 0,
MT_ENC_VUI_MATRIX_COEFFS_BT709 = 1,
MT_ENC_VUI_MATRIX_COEFFS_UNSPECIFIED = 2,
MT_ENC_VUI_MATRIX_COEFFS_RESERVED = 3,
MT_ENC_VUI_MATRIX_COEFFS_FCC = 4,
MT_ENC_VUI_MATRIX_COEFFS_BT470BG = 5,
MT_ENC_VUI_MATRIX_COEFFS_SMPTE170M = 6,
MT_ENC_VUI_MATRIX_COEFFS_SMPTE240M = 7,
MT_ENC_VUI_MATRIX_COEFFS_YCGCO = 8,
MT_ENC_VUI_MATRIX_COEFFS_BT2020_NCL = 9,
MT_ENC_VUI_MATRIX_COEFFS_BT2020_CL = 10,
MT_ENC_VUI_MATRIX_COEFFS_SMPTE2085 = 11
}
Enumerator MT_ENC_VUI_MATRIX_COEFFS_RGB
Enumerator MT_ENC_VUI_MATRIX_COEFFS_BT709
Enumerator MT_ENC_VUI_MATRIX_COEFFS_UNSPECIFIED
Enumerator MT_ENC_VUI_MATRIX_COEFFS_RESERVED
Enumerator MT_ENC_VUI_MATRIX_COEFFS_FCC
Enumerator MT_ENC_VUI_MATRIX_COEFFS_BT470BG
Enumerator MT_ENC_VUI_MATRIX_COEFFS_SMPTE170M
Enumerator MT_ENC_VUI_MATRIX_COEFFS_SMPTE240M
Enumerator MT_ENC_VUI_MATRIX_COEFFS_YCGCO
Enumerator MT_ENC_VUI_MATRIX_COEFFS_BT2020_NCL
Enumerator MT_ENC_VUI_MATRIX_COEFFS_BT2020_CL
Enumerator MT_ENC_VUI_MATRIX_COEFFS_SMPTE2085
Enumeration type _MTENCSTATUS
Definition: mtEncodeAPI.h (line 342)
enum _MTENCSTATUS {
MT_ENC_SUCCESS,
MT_ENC_ERR_NO_ENCODE_DEVICE,
MT_ENC_ERR_UNSUPPORTED_DEVICE,
MT_ENC_ERR_INVALID_PARAM,
MT_ENC_ERR_OUT_OF_MEMORY,
MT_ENC_ERR_ENCODER_NOT_INITIALIZED,
MT_ENC_ERR_INVALID_VERSION,
MT_ENC_ERR_MAP_FAILED,
MT_ENC_ERR_RESOURCE_NOT_MAPPED,
MT_ENC_ERR_NEED_MORE_INPUT,
MT_ENC_ERR_ENCODER_BUSY,
MT_ENC_ERR_GENERIC,
MT_ENC_ERR_RESOLUTION_MISMATCHED,
MT_ENC_ERR_PIXELFORMAT_MISMATCHED,
MT_ENC_ERR_INVALID_DESKTOP_ID,
MT_ENC_ERR_TIMEOUT,
MT_ENC_ERR_HDRSTATUS_MISMATCHED
}
Error codes.
Enumerator MT_ENC_SUCCESS
This indicates that the API call returned with no errors.
Enumerator MT_ENC_ERR_NO_ENCODE_DEVICE
Devices capable of encoding are not detected or invalid.