hi_venc_rc_param

Description

Defines the advanced RC parameters of an encoding channel.

Prototype

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h264_cbr_param": hi_venc_h264_cbr_param }

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h264_vbr_param":  hi_venc_h264_vbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h264_avbr_param": hi_venc_h264_avbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h264_qvbr_param": hi_venc_h264_qvbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h264_cvbr_param": hi_venc_h264_cvbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h265_cbr_param": hi_venc_h265_cbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h265_vbr_param": hi_venc_h265_vbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h265_avbr_param": hi_venc_h265_avbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h265_qvbr_param": hi_venc_h265_qvbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "h265_cvbr_param": hi_venc_h265_cvbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "mjpeg_cbr_param": hi_venc_mjpeg_cbr_param}

hi_venc_rc_param = {"threshold_i": threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_p": threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "threshold_b": threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE],
                    "direction": direction,
                    "row_qp_delta": row_qp_delta,
                    "first_frame_start_qp": first_frame_start_qp,
                    "scene_chg_detect": scene_chg_detect,
                    "mjpeg_vbr_param": hi_venc_mjpeg_vbr_param}

Members

Member

Description

threshold_i

List, MADi threshold for macroblock-level RC of I-frames, used to measure the spatial texture complexity of the current frame.

Value range: [0, 255]

Default value: [0, 0, 0, 0, 3, 3, 5, 5, 8, 8, 8, 15, 15, 20, 25, 25]

If the value of the subtraction direction is set to 0 or the value of the addition direction is set to 255, the current profile is disabled.

threshold_p

List, MADi threshold for macroblock-level RC of P-frames.

Value range: [0, 255]

Default value: [0, 0, 0, 0, 3, 3, 5, 5, 8, 8, 8, 15, 15, 20, 25, 25]

If the value of the subtraction direction is set to 0 or the value of the addition direction is set to 255, the current profile is disabled.

threshold_b

List, MADi threshold for macroblock-level RC of B-frames.

Value range: [0, 255]

Default value: [0, 0, 0, 0, 3, 3, 5, 5, 8, 8, 8, 15, 15, 20, 25, 25]

If the value of the subtraction direction is set to 0 or the value of the addition direction is set to 255, the current profile is disabled.

direction

Int, addition or subtraction direction control during texture-based macroblock-level bit rate control

Value range: [0, 16]

Default value: 8

For example, direction=7 indicates that the first seven parameters including threshold_i, threshold_p, and threshold_b are used for QP subtraction, and the last nine parameters are used for QP addition.

row_qp_delta

Maximum row-level adjustment range within one frame. The unit is the macroblock row. A larger adjustment amplitude indicates that the allowed QP row-level adjustment range is larger and the bit rate is more stable. In the scenarios where the picture complexity is unevenly distributed, the picture quality may be uneven if the value of this parameter is too large.

Value range: [0, 10]. The value 0 indicates that row-based macroblock-level bit rate control is disabled.

Default value: 1

first_frame_start_qp

Int, start QP value of the first frame. Valid in CBR, VBR, AVBR, QVBR, or CVBR mode. The "first frame" here indicates the upcoming first IDR frame when a channel is created, the GOP mode is updated, the RC mode is updated, or the resolution is updated. first_frame_start_qp has no effect on a re-encoded frame, which is not considered as a "first frame.

Must be -1 or in the range of [MinIQP, MaxIQP]. MinIQP and MaxIQP are set in the advanced RC parameter dictionary of the corresponding RC mode.

Defaults to -1, indicating that the start QP of the first frame is internally calculated by the encoder.

If the encoding effect is not good in the scenario with a low bit rate and a few motions, you can decrease the value of this parameter to improve the picture quality and effect.

For example, in the scenario where the resolution is 352 x 288, the frame rate is 25 FPS, and the GOP is 50, set first_frame_start_qp to 32 and max_reencode_times to 0 (indicating that re-encoding is not performed). This parameter is one of the advanced parameters of the bit rate control mode.

scene_chg_detect

Int, adaptive scene detection enable, which helps stabilize the bit rate during encoding scene transitions. Valid in VBR, AVBR, QVBR, or CVBR mode. Enable adaptive insertion of IDR frames at the meantime so that IDR frames can be encoded during scene transitions. Note that scene detection becomes invalid when re-encoding is disabled. It is recommended using this parameter in SCENE_0 mode.

h264_cbr_param

Dictionary, advanced CBR parameters of an H.264 channel.

h264_vbr_param

Dictionary, advanced VBR parameters of an H.264 channel.

h264_avbr_param

Dictionary, advanced AVBR parameters of an H.264 channel.

h264_qvbr_param

Dictionary, advanced QVBR parameters of an H.264 channel.

h264_cvbr_param

Dictionary, advanced CVBR parameters of an H.264 channel.

h265_cbr_param

Dictionary, advanced CBR parameters of an H.265 channel.

h265_vbr_param

Dictionary, advanced VBR parameters of an H.265 channel.

h265_avbr_param

Dictionary, advanced AVBR parameters of an H.265 channel.

h265_qvbr_param

Dictionary, advanced QVBR parameters of an H.265 channel.

h265_cvbr_param

Dictionary, advanced CVBR parameters of an H.265 channel.

mjpeg_cbr_param

Dictionary, advanced CBR parameters of an MJPEG channel. Reserved.

mjpeg_vbr_param

Dictionary, advanced VBR parameters of an MJPEG channel. Reserved.