aclvencSetChannelDesc Series

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function

Sets the attributes of the description of a video encoding channel.

Prototype

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
aclError aclvencSetChannelDescThreadId(aclvencChannelDesc *channelDesc, uint64_t threadId)
aclError aclvencSetChannelDescCallback(aclvencChannelDesc *channelDesc, aclvencCallback callback)
aclError aclvencSetChannelDescEnType(aclvencChannelDesc *channelDesc, acldvppStreamFormat enType)
aclError aclvencSetChannelDescPicFormat(aclvencChannelDesc *channelDesc, acldvppPixelFormat picFormat)
aclError aclvencSetChannelDescPicWidth(aclvencChannelDesc *channelDesc, uint32_t picWidth)
aclError aclvencSetChannelDescPicHeight(aclvencChannelDesc *channelDesc, uint32_t picHeight)
aclError aclvencSetChannelDescKeyFrameInterval(aclvencChannelDesc *channelDesc, uint32_t keyFrameInterval)
aclError aclvencSetChannelDescBufAddr(aclvencChannelDesc *channelDesc, void *bufAddr)
aclError aclvencSetChannelDescBufSize(aclvencChannelDesc *channelDesc, uint32_t bufSize)
aclError aclvencSetChannelDescRcMode(aclvencChannelDesc *channelDesc, uint32_t rcMode)
aclError aclvencSetChannelDescSrcRate(aclvencChannelDesc *channelDesc, uint32_t srcRate)
aclError aclvencSetChannelDescMaxBitRate(aclvencChannelDesc *channelDesc, uint32_t maxBitRate)

Parameters

Parameter

Input/Output

Description

channelDesc

Output

Pointer to the description of a video encoding channel.

Call the aclvencCreateChannelDesc API to create data of the aclvencChannelDesc type in advance.

threadId

Input

Callback thread ID.

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

callback

Input

Encoding callback function For details about the type definition, see aclvencCallback.

enType

Input

Video coding protocol. For details about the type definition, see acldvppStreamFormat.

picFormat

Input

Input format. For details about the type definition, see acldvppPixelFormat.

The following formats are supported:
  • PIXEL_FORMAT_YUV_SEMIPLANAR_420
  • PIXEL_FORMAT_YVU_SEMIPLANAR_420

picWidth

Input

Image width.

picHeight

Input

Image height.

keyFrameInterval

Input

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

bufAddr

Input

Pointer to the buffer address of the encoding output.

bufSize

Input

Buffer allocation in bytes of the encode output.

For the Atlas inference product, the default size 8 MB and the minimum size is 5 MB.

Atlas 200I/500 A2 inference product. If this parameter is not set, the default value 8 MB is used. If this parameter is set, the minimum value is 5 MB.

rcMode

Input

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

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

For the Atlas 200I/500 A2 inference product, the default value 0 indicates the VBR mode.

For the Atlas inference product, the default value 0 indicates the VBR mode.

srcRate

Input

Frame rate of the input stream (fps)

Atlas inference product: The value can be 0 or [1,240].

Atlas 200I/500 A2 inference product: The value can be 0 or [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.

maxBitRate

Input

Output bit rate (kbps)

Atlas inference product: The value range is [2,614400]. If this parameter is not set, the default value 2000 is used. If this parameter is set to 0, the default value 2000 is used.

Atlas 200I/500 A2 inference product: The value range is [2,614400]. If this parameter is not set, the default value 2000 is used. If this parameter is set to 0, the default value 2000 is used.

Returns

0 on success; otherwise, failure. For details, see aclError.