aclvencChannelDescParamType

The Ascend 910 AI Processor does not support this enumeration.

enum aclvencChannelDescParamType {
    ACL_VENC_THREAD_ID_UINT64 = 0,     //Callback thread ID. The value is of the uint64_t type.
    ACL_VENC_CALLBACK_PTR,              //Callback function. The value is a memory pointer.
    ACL_VENC_PIXEL_FORMAT_UINT32,      //Input image format. The value is of the uint32_t type.
    ACL_VENC_ENCODE_TYPE_UINT32,       //Video coding protocol. The value is of the uint32_t type.
    ACL_VENC_PIC_WIDTH_UINT32,          //Input image width. The value is of the uint32_t type.
    ACL_VENC_PIC_HEIGHT_UINT32,         //Input image height. The value is of the uint32_t type.
    ACL_VENC_KEY_FRAME_INTERVAL_UINT32, //Key frame interval. The value is of the uint32_t type.
    ACL_VENC_BUF_ADDR_PTR,              //Buffer address of the encoding output.
    ACL_VENC_BUF_SIZE_UINT32,         //Buffer size of the encoding output. The value is of the uint32_t type.
    ACL_VENC_RC_MODE_UINT32,             //Bit rate control mode. The value is of the uint32_t type.
    ACL_VENC_SRC_RATE_UINT32,           //Frame rate of the input stream. The value is of the uint32_t type.
    ACL_VENC_MAX_BITRATE_UINT32,       //Output bit rate. The value is of the uint32_t type.
    ACL_VENC_MAX_IP_PROP_UINT32        //I-frame to P-frame bit allocation ratio within a GOP. The value is of the uint32_t type.
}
Table 1 Attribute settings

Attribute

Description

ACL_VENC_THREAD_ID_UINT64

Callback thread ID.
NOTE:

Do not pass the same thread ID for subscribing to VENC callback functions on different devices in the same process.

ACL_VENC_CALLBACK_PTR

Encoding callback function.

ACL_VENC_PIXEL_FORMAT_UINT32

Image format.
  • PIXEL_FORMAT_YUV_SEMIPLANAR_420
  • PIXEL_FORMAT_YVU_SEMIPLANAR_420

ACL_VENC_ENCODE_TYPE_UINT32

Video coding protocol.

For details, see acldvppStreamFormat.

ACL_VENC_PIC_WIDTH_UINT32

Image width.

ACL_VENC_PIC_HEIGHT_UINT32

Image height.

ACL_VENC_KEY_FRAME_INTERVAL_UINT32

Key frame interval. Must be in the range of [1, 65536].

ACL_VENC_BUF_ADDR_PTR

Pointer to the buffer address of the encoding output.
NOTE:

In the current version of the Ascend 310 AI Processor of the Ascend 910 AI Processor, this parameter is unconfigurable. VENC manages the buffer address internally.

In the current version, it is not supported to obtain this attribute. The value obtained is invalid.

ACL_VENC_BUF_SIZE_UINT32

Size of the encoding output buffer, in bytes.
NOTE:

For the Ascend 310 AI Processor, it is not allowed to set this parameter in the current version. It defaults to 3686400 bytes.

For the Ascend 910 AI Processor, it is not allowed to set this parameter in the current version. It defaults to 3686400 bytes.

For the Ascend 310P AI Processor, if this parameter is not specified, the default value 8 MB is used. The minimum value is 5 MB.

In the current version, it is not supported to obtain this attribute. The value obtained is invalid.

ACL_VENC_RC_MODE_UINT32

Bit rate control mode.
  • 0: default mode.
  • 1: variable bit rate (VBR) mode
  • 2: constant bit rate (CBR) mode
NOTE:

If this parameter is not set, the default value 0 is used.

For the Ascend 310 AI Processor, the default value 0 indicates the CBR mode.

For the Ascend 310 AI Processor, the default value 0 indicates the CBR mode.

For the Ascend 610 AI Processor, the default value 0 indicates the VBR mode.

ACL_VENC_SRC_RATE_UINT32

Frame rate of the input stream (FPS).

For the Ascend 310 AI Processor, the value is 0 or in the range of [1, 120].

For the Ascend 310 AI Processor, the value is 0 or in the range of [1, 120].

For the Ascend 610 AI Processor, the value is 0 or in the range of [1, 240].

If it is not set or set to 0, the default value 30 is used. If the difference between the value of this parameter and the actual frame rate of the input stream is too large, the output bit rate is affected.

ACL_VENC_MAX_BITRATE_UINT32

Output bit rate (kbit/s).

For the Ascend 310 AI Processor, the value is 0 or in the range of [10, 30000]. The default value is 300. If it is set to 0, the default value 300 is used.

For the Ascend 910 AI Processor, the value is 0 or in the range of [10, 30000]. The default value is 300. If it is set to 0, the default value 300 is used.

For the Ascend 610 AI Processor, the value range is [2, 614400]. The default value is 2000. If it is set to 0, the default value 2000 is used.

ACL_VENC_MAX_IP_PROP_UINT32

I-frame to P-frame bit allocation ratio within a GOP. Must be 0 or within the range of [1, 100]. The default value is 80 in VBR mode or 70 in CBR mode. If it is set to 0, the default value is used.