# hi_venc_rc_attr

#### 说明

定义编码通道码率控制器属性。


#### 定义

```
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h264_cbr":
hi_venc_h264_cbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h264_vbr":
hi_venc_h264_vbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h264_avbr":
hi_venc_h264_avbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h264_qvbr":
hi_venc_h264_qvbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h264_cvbr":
hi_venc_h264_cvbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h264_fixqp":
hi_venc_h264_fixqp
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h264_qpmap":
hi_venc_h264_qpmap
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"mjpeg_cbr":
hi_venc_mjpeg_cbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"mjpeg_vbr":
hi_venc_mjpeg_vbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"mjpeg_fixqp":
hi_venc_mjpeg_fixqp
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h265_cbr":
hi_venc_h265_cbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h265_vbr":
hi_venc_h265_vbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h265_avbr":
hi_venc_h265_avbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h265_qvbr":
hi_venc_h265_qvbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h265_cvbr":
hi_venc_h265_cvbr
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h265_fixqp":
hi_venc_h265_fixqp
}
hi_venc_rc_attr = {"rc_mode": rc_mode, # RW; the type of rc
"h265_qpmap":
hi_venc_h265_qpmap
}
```


#### 成员

| 成员名称 | 描述 |
| --- | --- |
| rc\_mode | RC模式。 CBR（Constant Bit Rate）固定比特率。即在码率统计时间内保证编码码率平稳。 VBR（Variable Bit Rate）可变比特率，即允许在码率统计时间内编码码率波动，从而保证编码图像质量平稳。 AVBR（Adaptive Variable Bit Rate） 自适应可变比特率，即允许在码率统计时间内编码码率波动，从而保证编码图像质量平稳。码率控制内部会检测当前场景的运动静止状态，在运动时用较高码率编码，在静止时主动降低目标码率。 QVBR（Quality Variable Bit Rate）基于主观图像质量的可变比特率，该码控调节方式是利用实时统计的 PSNR（图像质量客观评价指标）的大小来动态调整码率，从而保证编码图像质量平稳。在PSNR较小时主动升高目标码率，PSNR较大时主动降低目标码率。 CVBR（Constrained Variable Bit Rate）是以VBR为基础，旨在提供平稳的图像质量的码控算法，同时对VBR的码率进行限制，以满足传输带宽以及存储空间的要求。具体来说， CVBR设置了瞬时，短期与长期码率的限制。其中，瞬时码率的限制保证了网络带宽对传输的要求；长期码率限制保证了在长时间视频录制时，存储设备有足够的空间储存数据；同时，短期码率会根据长期码率的设置和实际使用情况进行调节，以在场景复杂的情况下提供更加平稳的图像质量，并在场景简单时节省码率。 FIXQP（Fix Quantisation Parameter）固定QP值。在码率统计时间内，编码图像所有宏块QP值相同，采用用户设定的图像QP值，I帧和P帧的QP值可以分别设置。 对于不同协议，相同 RC 模式的属性变量基本一致。表1介绍了几种RC模式的公共的属性。 |
| h264\_cbr | 字典，H.264协议编码通道CBR模式属性。 |
| h264\_vbr | 字典，H.264协议编码通道VBR模式属性。 |
| h264\_avbr | 字典，H.264协议编码通道AVBR模式属性。 |
| h264\_qvbr | 字典，H.264协议编码通道QVBR模式属性。 |
| h264\_cvbr | 字典，H.264协议编码通道CVBR模式属性。 |
| h264\_fixqp | 字典，H.264协议编码通道FIXQP模式属性。 Atlas 推理系列产品 ，预留参数，暂不支持。 Atlas A2 训练系列产品 / Atlas A2 推理系列产品 ，预留参数，暂不支持。 Atlas A3 训练系列产品 / Atlas A3 推理系列产品 ，预留参数，暂不支持。 |
| h264\_qpmap | 字典，H.264协议编码通道QPMAP模式属性。预留参数，暂不支持。 |
| mjpeg\_fixqp | 字典，MJPEG（Motion Joint Photographic Experts Group）协议编码通道FIXQP模式属性。预留参数，暂不支持。 |
| mjpeg\_cbr | 字典，MJPEG协议编码通道CBR模式属性。预留参数，暂不支持。 |
| mjpeg\_vbr | 字典，MJPEG协议编码通道VBR模式属性。预留参数，暂不支持。 |
| h265\_cbr | 字典，H.265协议编码通道CBR模式属性。 |
| h265\_vbr | 字典，H.265协议编码通道VBR模式属性。 |
| h265\_avbr | 字典，H.265协议编码通道AVBR模式属性。 |
| h265\_qvbr | 字典，H.265协议编码通道QVBR模式属性。 |
| h265\_cvbr | 字典，H.265协议编码通道CVBR模式属性。 |
| h265\_fixqp | 字典，H.265协议编码通道FIXQP模式属性。 Atlas 推理系列产品 ，预留参数，暂不支持。 Atlas A2 训练系列产品 / Atlas A2 推理系列产品 ，预留参数，暂不支持。 Atlas A3 训练系列产品 / Atlas A3 推理系列产品 ，预留参数，暂不支持。 |
| h265\_qpmap | 字典，H.265协议编码通道QPMAP模式属性。预留参数，暂不支持。 |


#### 参考信息


**表1 码率控制器属性的约束**

| RC 模式 | GOP | StatTime(s) | FrmRate(src\_frame\_rate/dst\_frame\_rate) |
| --- | --- | --- | --- |
| CBR | ≥ 1 | ≥ 1 | src\_frame\_rate ≥ dst\_frame\_rate |
| VBR | ≥ 1 | ≥ 1 | src\_frame\_rate ≥ dst\_frame\_rate |
| AVBR | ≥ 1 | ≥ 1 | src\_frame\_rate ≥ dst\_frame\_rate |
| FIXQP | ≥ 1 | ≥ 1 | src\_frame\_rate ≥ dst\_frame\_rate |
| QPMAP | ≥ 1 | ≥ 1 | src\_frame\_rate ≥ dst\_frame\_rate |
