定义编码器属性字典。
hi_venc_attr = {"type": hi_payload_type, "max_pic_width": max_pic_width, "max_pic_height": max_pic_height, "buf_size": buf_size, "profile": profile, "is_by_frame": is_by_frame, "pic_width": pic_width, "pic_height": pic_height, "h264_attr":hi_venc_h264_attr} # attributes of H264e hi_venc_attr = {"type": type, "max_pic_width": max_pic_width, "max_pic_height": max_pic_height, "buf_size": buf_size, "profile": profile, "is_by_frame": is_by_frame, "pic_width": pic_width, "pic_height": pic_height, "h265_attr":hi_venc_h265_attr} # attributes of H265e hi_venc_attr = {"type": hi_payload_type, "max_pic_width": max_pic_width, "max_pic_height": max_pic_height, "buf_size": buf_size, "profile": profile, "is_by_frame": is_by_frame, "pic_width": pic_width, "pic_height": pic_height, "jpeg_attr":hi_venc_jpeg_attr} # attributes of jpeg hi_venc_attr = {"type": hi_payload_type, "max_pic_width": max_pic_width, "max_pic_height": max_pic_height, "buf_size": buf_size, "profile": profile, "is_by_frame": is_by_frame, "pic_width": pic_width, "pic_height": pic_height, "prores_attr":hi_venc_prores_attr} # attributes of prores
成员名称 |
描述 |
---|---|
type |
整型, 编码协议类型。 |
max_pic_width |
整型, 编码图像最大宽度,静态属性,必须是2的整数倍。 取值范围:[MIN_WIDTH, MAX_WIDTH],以像素为单位。 |
max_pic_height |
整型, 除jpeg协议外,编码图像最大高度,静态属性,必须是2的整数倍。 取值范围:[MIN_HEIGHT, MAX_HEIGHT],以像素为单位。 |
buf_size |
整型, 码流buffer大小,单位为Byte,静态属性,必须是64的整数倍。昇腾310 AI处理器暂不支持该参数,预留。昇腾910 AI处理器暂不支持该参数,预留。 取值范围:[Min, Max],以 byte 为单位。Min表示32*1024,Max表示该参数数据类型的最大值。
调用接口acl.himpi.venc_set_mod_param设置模块参数mini_buf_mode可以选择取值范围限制方式。
说明:
在实现JPEGE功能时,用户可以在创建通道时根据业务场景中图片的实际最大分辨率,按照如下公式设置JPEGE内部缓存的大小,以节省内存使用开销:原图宽 * 原图高 * 倍数 * 路数,倍数推荐为5,算子化场景倍数推荐为4,路数最多支持128路。 例如:用户图片的分辨率有720p(1280x720)、1080p(1080x1920)、4K(3840x2160)大小的图片,需要的JPEGE内存大小应按照4k配置:3840 * 2160 * 5 * 路数。 JPEGE内部缓存的最小值为320 * 240 * 5 * 路数 ,防止小分辨率场景下,buffer容易被占满,影响JPEGE功能执行,例如:用户图片的最大分辨率为128x128,推荐用户将内部缓存的大小设置为320 * 240 * 5 * 路数。 |
profile |
整型, 编码的等级,静态属性。
|
is_by_frame |
整型, 帧/包模式获取码流,静态属性。昇腾310 AI处理器暂不支持该参数,预留。昇腾910 AI处理器暂不支持该参数,预留。
|
pic_width |
整型, 编码图像宽度,必须是 MIN_ALIGN 的整数倍。 取值范围:[MIN_WIDTH, MAX_WIDTH],以像素为单位。 |
pic_height |
整型, 除jpeg协议外,编码图像高度,必须是 MIN_ALIGN 的整数倍。 取值范围:[MIN_HEIGHT, MAX_HEIGHT],以像素为单位。 |
h264_attr/h265_attr/jpeg_attr/prores_attr |
字典, 编码协议的属性。 预留参数,暂不支持。 |