创建通道

Atlas 200/300/500 推理产品 aclvenc接口

Atlas 推理系列产品(Ascend 310P处理器) hi_mpi接口

Atlas 200/300/500 推理产品->Atlas 推理系列产品(Ascend 310P处理器)迁移时,对用户的影响

创建通道描述信息的结构体:

aclvencCreateChannelDesc

无对应接口,直接使用hi_venc_chn_attr结构体。

用户需要修改代码,直接声明hi_venc_chn_attr结构体的变量。

设置通道描述的参数:

aclvencSetChannelDescEnType

aclvencSetChannelDescPicWidth

aclvencSetChannelDescPicHeight

aclvencSetChannelDescKeyFrameInterval

aclvencSetChannelDescThreadId(仅acl有)

aclvencSetChannelDescCallback(仅acl有)

aclvencSetChannelDescRcMode

aclvencSetChannelDescSrcRate

aclvencSetChannelDescMaxBitRate

aclvencSetChannelDescPicFormat(仅acl有)

无对应接口,直接对hi_venc_chn_attr结构体的成员赋值:

hi_venc_chn_attr.venc_attr.type

hi_venc_chn_attr.venc_attr.pic_width

hi_venc_chn_attr.venc_attr.pic_height

hi_venc_chn_attr.rc_attr.h26x_xbr.gop

hi_venc_chn_attr.rc_attr.rc_mode

hi_venc_chn_attr.rc_attr.h26x_xbr.src_frame_rate

hi_venc_chn_attr.rc_attr.h26x_xbr.bit_rate

用户需要修改代码,对结构体hi_venc_chn_attr成员赋值来配置通道描述的参数。

需注意,对于仅acl有的这几个参数设置,在hi_mpi上也有对应的接口:

  • 线程ID、Callback(这两个跟回调函数相关),不在hi_venc_chn_attr结构体中,因为使用hi mpi接口时不需要设置回调函数,需要自行另起线程,调用hi_mpi_venc_get_stream接口来获取编码结果。
  • 输入图片格式不在hi_venc_chn_attr结构体中,是在调用hi_mpi_venc_send_frame接口发送编码数据帧时通过hi_video_frame_info.v_frame.pixel_format参数指定。

创建通道:

aclvencCreateChannel

创建通道:

hi_mpi_venc_create_chn

用户需要修改代码,改用hi_mpi_venc_create_chn接口创建通道。