aclvencChannelDesc
aclvencCreateChannelDesc
函数功能
创建aclvencChannelDesc类型的数据,表示创建视频编码处理通道时的通道描述信息。同步接口。
如需销毁aclvencChannelDesc类型的数据,请参见aclvencDestroyChannelDesc。
昇腾910 AI处理器,当前版本不支持该接口。
函数原型
aclvencChannelDesc *aclvencCreateChannelDesc()
参数说明
无
返回值说明
- 返回aclvencChannelDesc类型的指针,表示成功。
- 返回nullptr,表示失败。
aclvencSetChannelDesc系列接口
函数功能
设置视频编码处理通道描述信息的属性。同步接口。
昇腾910 AI处理器,当前版本不支持该接口。
函数原型
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)
参数说明
参数名 |
输入/输出 |
说明 |
---|---|---|
channelDesc |
输出 |
表示视频编码处理通道的描述信息。 需提前调用aclvencCreateChannelDesc接口创建aclvencChannelDesc类型的数据。 |
threadId |
输入 |
回调线程ID。
说明:
同一个进程内,在不同的Device上注册VENC编码回调函数的线程时,不能指定同一个线程ID。 |
callback |
输入 |
编码回调函数。 |
enType |
输入 |
视频编码协议。 |
picFormat |
输入 |
输入图像格式,支持如下格式:
|
picWidth |
输入 |
图片宽度。 |
picHeight |
输入 |
图片高度。 |
keyFrameInterval |
输入 |
关键帧间隔,取值范围[1,65536]。 |
bufAddr |
输入 |
编码输出缓存地址。
说明:
在昇腾310 AI处理器上,在昇腾910 AI处理器上,当前版本不支持用户设置该参数,由VENC内部管理该缓存地址。 |
bufSize |
输入 |
编码输出缓存大小,单位为Byte。
说明:
在昇腾310 AI处理器上,在昇腾910 AI处理器上,当前版本不支持用户设置该参数,内部默认使用3686400 Byte。 |
rcMode |
输入 |
指定码率控制模式。
说明:
如果不设置该参数,则采用默认值0。 昇腾310 AI处理器,默认值0表示CBR模式。 昇腾910 AI处理器,默认值0表示CBR模式。 |
srcRate |
输入 |
输入码流帧率,单位fps。 昇腾310 AI处理器,取值范围0或者[1,120]。 昇腾910 AI处理器,取值范围0或者[1,120]。 如果不设置该参数,默认为30;如果设置为0,表示使用默认值,即30。如果该值和实际输入码流帧率相差太大,会影响输出码率。 |
maxBitRate |
输入 |
输出码率,单位kbps。 昇腾310 AI处理器,取值范围0或[10,30000]。如果不设置该参数,默认为300;如果设置为0,表示使用默认值,即300。 昇腾910 AI处理器,取值范围0或[10,30000]。如果不设置该参数,默认为300;如果设置为0,表示使用默认值,即300。 |
返回值说明
返回0表示成功,返回其它值表示失败。
aclvencGetChannelDesc系列接口
函数功能
获取视频编码处理通道的描述信息。同步接口。
昇腾910 AI处理器,当前版本不支持该接口。
函数原型
uint32_t aclvencGetChannelDescChannelId(const aclvencChannelDesc *channelDesc);
uint64_t aclvencGetChannelDescThreadId(const aclvencChannelDesc *channelDesc);
aclvencCallback aclvencGetChannelDescCallback(const aclvencChannelDesc *channelDesc);
acldvppStreamFormat aclvencGetChannelDescEnType(const aclvencChannelDesc *channelDesc);
acldvppPixelFormat aclvencGetChannelDescPicFormat(const aclvencChannelDesc *channelDesc);
uint32_t aclvencGetChannelDescPicWidth(const aclvencChannelDesc *channelDesc);
uint32_t aclvencGetChannelDescPicHeight(const aclvencChannelDesc *channelDesc);
uint32_t aclvencGetChannelDescKeyFrameInterval(const aclvencChannelDesc *channelDesc);
void *aclvencGetChannelDescBufAddr(const aclvencChannelDesc *channelDesc);
uint32_t aclvencGetChannelDescBufSize(const aclvencChannelDesc *channelDesc);
uint32_t aclvencGetChannelDescRcMode(const aclvencChannelDesc *channelDesc);
uint32_t aclvencGetChannelDescSrcRate(const aclvencChannelDesc *channelDesc);
uint32_t aclvencGetChannelDescMaxBitRate(const aclvencChannelDesc *channelDesc)
参数说明
参数名 |
输入/输出 |
说明 |
---|---|---|
channelDesc |
输入 |
表示视频编码处理通道的描述信息。 需提前调用aclvencCreateChannelDesc接口创建aclvencChannelDesc类型的数据,调用aclvencSetChannelDesc系列接口设置视频编码处理通道描述信息的属性值。 |
返回值说明
参数名 |
说明 |
---|---|
channelId |
通道号,默认为0。 |
threadId |
回调线程ID。 |
callback |
编码回调函数。 |
enType |
视频编码协议。 |
picFormat |
输入图像格式。 |
picWidth |
图片宽度。 |
picHeight |
图片高度。 |
keyFrameInterval |
关键帧间隔,不能为0。 |
bufAddr |
编码输出缓存地址。 在昇腾310 AI处理器上,在昇腾910 AI处理器上,当前版本获取该参数的值为无效值,不支持获取该参数值。 |
bufSize |
编码输出缓存大小,单位为Byte。 在昇腾310 AI处理器上,在昇腾910 AI处理器上,当前版本获取该参数的值为无效值,不支持获取该参数值。 |
rcMode |
指定码率控制模式。
|
srcRate |
输入码流帧率,单位fps。 |
maxBitRate |
输出码率,单位kbps。 |
aclvencSetChannelDescParam
函数功能
设置视频编码处理通道的属性参数接口。同步接口。
昇腾910 AI处理器,当前版本不支持该接口。
函数原型
aclError aclvencSetChannelDescParam(aclvencChannelDesc *channelDesc, aclvencChannelDescParamType paramType, size_t length, const void *param)
参数说明
参数名 |
输入/输出 |
说明 |
---|---|---|
channelDesc |
输入 |
表示视频编码处理通道的描述信息。 需提前调用aclvencCreateChannelDesc接口创建aclvencChannelDesc类型的数据。 |
paramType |
输入 |
属性参数的类型。 |
length |
输入 |
属性参数值的字节数。
|
param |
输入 |
指向属性参数值的指针。 |
返回值说明
返回0表示成功,返回其它值表示失败。
aclvencGetChannelDescParam
函数功能
获取视频编码处理通道的描述信息。同步接口。
昇腾910 AI处理器,当前版本不支持该接口。
函数原型
aclError aclvencGetChannelDescParam(const aclvencChannelDesc *channelDesc, aclvencChannelDescParamType paramType, size_t length, size_t *paramRetSize, void *param)
参数说明
参数名 |
输入/输出 |
说明 |
---|---|---|
channelDesc |
输入 |
表示视频编码处理通道的描述信息。 需提前调用aclvencCreateChannelDesc接口创建aclvencChannelDesc类型的数据,调用aclvencSetChannelDescParam接口设置视频编码处理通道描述信息的属性值。 |
paramType |
输入 |
属性参数的类型。 |
length |
输入 |
属性参数值的字节数。
|
paramRetSize |
输出 |
实际返回的属性参数值的字节数。 |
param |
输出 |
指向属性参数值的指针。 |
返回值说明
返回0表示成功,返回其它值表示失败。
aclvencDestroyChannelDesc
函数原型
aclError aclvencDestroyChannelDesc(aclvencChannelDesc *channelDesc)
参数说明
参数名 |
输入/输出 |
说明 |
---|---|---|
channelDesc |
输入 |
待销毁的aclvencChannelDesc类型的指针。 |
返回值说明
返回0表示成功,返回非0表示失败。