2. Meaning and Usage of Bit Rate Control Parameters

2.1. CBR Parameter Description and Usage

CBR parameters are shown in the following table.

Parameters

Description

Usage Recommendation

u32Gop

I-frame interval

Set it to an integer multiple of the frame rate

u32StatTime

Bit rate statistics duration (unit: seconds)

Set it to an integer multiple of (GOP/frame rate)

A shorter statistics duration produces smaller short-term bit rate fluctuations

A longer statistics duration produces larger short-term bit rate fluctuations but better image quality

u32BitRate

Target bit rate

Set it according to the application scenario. A higher target bit rate provides better image quality but requires more bandwidth

u32MaxQp

Maximum QP

Limits the maximum QP of a macroblock.

This limits the worst image quality. Setting it too low may cause bit rate overshoot.

Recommended value: [40, 51]

u32MinQp

Minimum QP

Limits the minimum QP of a macroblock.

This limits the best image quality and saves bit rate when quality is sufficient. Setting it too high may result in insufficient bit rate.

Recommended value: [12, 20]

u32MaxIQp

Maximum I-frame QP

Limits the maximum QP of I-frame macroblocks.

For static scenes, a smaller maximum QP is recommended to improve the quality of static areas.

Recommended value: [36, 44]

u32MinIQp

Minimum I-frame QP

Limits the minimum QP of I-frame macroblocks and saves bit rate when quality is sufficient.

Recommended value: [16, 24]

2.2. VBR Parameter Description and Usage

VBR parameters are shown in the following table.

Parameters

Description

Usage Recommendation

u32Gop

I-frame interval

Set it to an integer multiple of the frame rate

u32StatTime

Bit rate statistics duration (unit: seconds)

Set it to an integer multiple of (GOP/frame rate).

A shorter statistics duration produces smaller short-term bit rate fluctuations.

A longer statistics duration produces larger short-term bit rate fluctuations but better image quality

u32MaxBitRate

Maximum bit rate

Set it according to the application scenario. A higher maximum bit rate provides better image quality but requires more bandwidth

s32ChangePos

Bit rate adjustment threshold

The recommended adjustment range is [75, 90].

If bit rate overshoot is important, 75 is recommended.

Otherwise, 90 is sufficient.

u32MaxQp

Maximum QP

Limits the maximum QP of a macroblock.

This limits the worst image quality. Setting it too low may cause bit rate overshoot.

Recommended value: [40, 51]

u32MinQp

Minimum QP

Limits the minimum QP of a macroblock.

This limits the best image quality and saves bit rate when quality is sufficient. Setting it too high may result in insufficient bit rate.

Recommended value: [12, 20]

u32MaxIQp

Maximum I-frame QP

Limits the maximum QP of I-frame macroblocks.

For static scenes, a smaller maximum QP is recommended to improve the quality of static areas.

Recommended value: [36, 44]

u32MinIQp

Minimum I-frame QP

Limits the minimum QP of I-frame macroblocks and saves bit rate when quality is sufficient.

Recommended value: [16, 24]

2.3. AVBR Parameter Description and Usage

AVBR parameters are shown in the following table.

Parameters

Description

Usage Recommendation

u32Gop

I-frame interval

Set it to an integer multiple of the frame rate

u32StatTime

Bit rate statistics duration (unit: seconds)

Set it to an integer multiple of (GOP/frame rate).

A shorter statistics duration produces smaller short-term bit rate fluctuations.

A longer statistics duration produces larger short-term bit rate fluctuations but better image quality.

u32MaxBitRate

Maximum bit rate

Set it according to the application scenario. A higher maximum bit rate provides better image quality but requires more bandwidth

s32ChangePos

Bit rate adjustment threshold

The recommended adjustment range is [75, 90].

If bit rate overshoot is important, 75 is recommended.

Otherwise, 90 is sufficient.

u32MaxQp

Maximum QP

Limits the maximum QP of a macroblock.

This limits the worst image quality. Setting it too low may cause bit rate overshoot.

Recommended value: [40, 51]

u32MinQp

Minimum QP

Limits the minimum QP of a macroblock.

This limits the best image quality and saves bit rate when quality is sufficient. Setting it too high may result in insufficient bit rate.

Recommended value: [12, 20]

u32MaxIQp

Maximum I-frame QP

Limits the maximum QP of I-frame macroblocks.

For static scenes, a smaller maximum QP is recommended to improve the quality of static areas.

Recommended value: [36, 44]

u32MinIQp

Minimum I-frame QP

Limits the minimum QP of I-frame macroblocks and saves bit rate when quality is sufficient.

Recommended value: [16, 24]

s32MinStillPercent

Target bit rate percentage when the scene is completely static

The minimum bit rate for a static scene is the maximum bit rate multiplied by this percentage. A smaller setting produces a more significant bit rate reduction in static scenes.

Recommended value: [10, 50]

u32MaxStillQp

Maximum QP when the scene is static

A smaller setting better preserves image quality in static and low-motion scenes.

Recommended value: [32, 40]

u32MotionSensitivity

Motion sensitivity

Sets the sensitivity of bit rate adjustment to scene motion. A larger value makes bit rate control respond faster to motion changes.

Recommended value: [12, 40]

s32AvbrPureStillThr

Static threshold

A value below the threshold is treated as completely static.

Recommended value: [0, 20]

s32AvbrFrmLostOpen

AVBR frame-drop switch

Enables frame dropping for completely static images to reduce the bit rate when the image is static.

s32AvbrFrmGap

AVBRMaximum consecutive dropped frames.

Limits the maximum consecutive dropped frames for static AVBR images.

Recommended value: 1

2.4. Macroblock-Level Bit Rate Control Parameter Description and Usage

Macroblock-LevelThe bit rate control parameters are shown in the following table.

Parameters

Description

Usage Recommendation

u32RowQpDelta

Macroblock-level bit rate control QP delta parameter

A value greater than 0 enables macroblock-level control for bit rate stability. Recommended value: 1

The adjustment effect of the row QP delta is currently not particularly obvious

s32FirstFrameStartQp

Initial QP of the first frame

Set an appropriate initial QP according to the target bit rate, resolution, and scene.

Recommended value: 36

The values are as follows:

H.264: 1~51

H.265: 1 to 51; 63 (determined internally)

u32ThrdLv

Texture macroblock-level automatic bit rate control parameter

The system adaptively adjusts the threshold level for texture-level bit rate control.

Default value: 2. Range: 0 to 4

Controls the QP distribution range for intra-frame encoding. A smaller value reduces the difference between the maximum and minimum QP and can be used to adjust breathing and ghosting.

2.5. Frame Dropping Parameters and Usage for Excessive Bit Rates

Frame Dropping for Excessive Bit RatesThe parameters are shown in the following table.

Parameters

Description

Usage Recommendation

bFrmLostOpen

Bit rate overshoot frame-drop switch

Drops frames when the bit rate exceeds the threshold to keep interval bit rate peaks from becoming too high.

u32FrmLostBpsThr

Bit rate overshoot frame-drop threshold

Set it according to system capability; at least 1.2 times the bit rate is recommended

enFrmLostMode

Frame-drop mode selection

Only the frame-drop mode that encodes PSkip frames is supported

u32EncFrmGaps

Maximum consecutive dropped frames

Limits the maximum number of consecutive dropped frames

Makes images smoother while frames are dropped, but interval bit rate peaks may be higher.

A value of 0 means that the number of consecutive dropped frames is unlimited