2. Meaning and Usage of Bitrate Control Parameters

2.1. CBR Parameter Description and Usage

The description of CBR parameters is shown in the table below.

Parameter

Description

Suggestions

u32Gop

I-Frame interval

Recommended to set to an integral-multiple of the frame rate

u32StatTime

Bit rate statistics time length (unit: seconds)

Recommended to set as an integral-multiple of Gop or frame rate.

A smaller statistical time length makes the short-term bit rate fluctuation smaller.

while a larger statistical time length makes the short-term rate fluctuation larger and the image quality better.

u32BitRate

Target bitrate

According to the actual scene settings, the higher the target bit rate, the better the image quality, and the higher the bandwidth required.

u32MaxQp

Maximum Qp

This limits the maximum Qp of macroblock, and also limits the worst image quality.

If the bit rate is set too low, it may lead to a greater chance of bit rate overshoot.

Recommended value: [40, 51]

u32MinQp

Minimun Qp

This limits the minimum Qp of macroblock, and also limits the best image quality.

It will save bit rate when the quality is good enough. An overhigh setting may result in insufficient bit rate.

Recommended value: [12, 20]

u32MaxIQp

Maximum I-Frame Qp

Limit the maximum Qp of I-Frame macroblock.

For the still scene, it is recommended to set a smaller maximum Qp to make the quality of the still part of the image better.

Recommended value: [36, 44]

u32MinIQp

Minimum I-Frame Qp

Limit the minimum Qp of I-Frame macroblock. Save the bit rate when the quality is good enough.

Recommended value: [16, 24]

2.2. VBR Parameter Description and Usage

The description of VBR parameters is shown in the table below.

Parameter

Description

Suggestions

u32Gop

I-Frame interval

Recommended to set it to an integral-multiple of the frame rate

u32StatTime

Bit rate statistics time length (unit: seconds)

Recommended to set it as an integral-multiple of (Gop / frame rate).

A smaller statistical time makes the short-term rate fluctuation smaller.

while a larger statistical time length makes the short-term rate fluctuation larger and the image quality better.

u32MaxBitRate

Maximum Bitrate

Set according to the application scenario.

The larger the maximum bit rate, the better the image quality and the higher the required bandwidth.

s32ChangePos

Rate adjustment threshold

It is suggested to adjust the interval between [75, 90].

If more attention is paid to the bit rate exceeding, it is suggested to set to 75.

Otherwise, set the threshold to 90 when the bit rate exceeding has little effect.

u32MaxQp

Maximum Qp

To limit the maximum Qp of macroblock. Is to limit the worst image quality.

If the bit rate is set too low, it may lead to a greater chance of bit rate overshoot.

Recommended value: [40, 51]

u32MinQp

Minimum Qp

To limit the minimum Qp of macroblock, is to limit the best image quality, and reduce the bit rate when the quality is good enough.

An overhigh setting may result in insufficient bit rate.

Recommended value: [12, 20]

u32MaxIQp

Maximum I-Frame Qp

Limit the maximum Qp of I-Frame macroblock.

For the still scene, it is recommended to set a smaller maximum Qp to make the quality of the still part of the image better.

Recommended value: [36, 44]

u32MinIQp

Minimum I-Frame Qp

Limit the minimum Qp of I-Frame macroblock. Reduce the bit rate when the quality is good enough.

Recommended value: [16, 24]

2.3. AVBR Parameter Description and Usage

The description of AVBR parameters is shown in the table below.

Parameter

Description

Suggestions

u32Gop

I-Frame interval

Recommended to set it to an integral multiple of the frame rate

u32StatTime

Bit rate statistics time length (unit: seconds)

Suggested to set it as an integral multiple of (Gop / frame rate).

A smaller statistical time makes the short-term rate fluctuation smaller.

while a larger statistical time length makes the short-term rate fluctuation larger and the image quality better.

u32MaxBitRate

Maximum Bitrate

Set according to the application scenario. The larger the maximum bit rate, the better the image quality and the higher the required bandwidth.

s32ChangePos

Rate adjustment threshold

It is suggested to adjust the interval between [75, 90].

If more attention is paid to the bit rate exceeding, it is suggested to set to 75.

Otherwise, set the threshold to 90 when the bit rate exceeding has little effect.

u32MaxQp

Maximum Qp

Limit the maximum Qp of macroblock.

That is, limit the worst image quality.

If the bit rate is set too low, it may lead to a greater chance of bit rate overshoot.

Recommended value: [40, 51]

u32MinQp

Minimum Qp

Limit the minimum Qp of macroblock.

That is, limit the best image quality, and save the bit rate when the quality is good enough. An overhigh setting may result in insufficient bit rate.

Recommended value: [12, 20]

u32MaxIQp

Maximum I-Frame Qp

Limit the maximum Qp of I-Frame macroblock.

For the still scene, it is recommended to set a smaller maximum Qp to make the quality of the still part of the image better.

Recommended value: [36, 44]

u32MinIQp

Minimum I-Frame Qp

Limit the minimum Qp of I-Frame macroblock. Reduce the bit rate when the quality is good enough.

Recommended value: [16, 24]

s32MinStillPercent

Static scene bitrate percentage

The minimum bit rate of still scenes is the maximum bit rate multiplied by the percentage set. The smaller the setting, the more significant the bit rate drop in still scenes.

Recommended value: [10, 50]

u32MaxStillQp

Max Qp for Still Picture

The smaller the setting, the better the image quality can be guaranteed for still scenes and minor movements.

Recommended value:[32, 40]

u32MotionSensitivity

Motion sensitivity

The degree of scene motion corresponds to the sensitivity setting of bit rate adjustment.

The larger the value, the faster the rate control responds to changes in motion.

Recommended value:[12, 40]

s32AvbrPureStillThr

Static Threshold

Below the threshold is considered completely still.

Recommended value:[0, 20]

s32AvbrFrmLostOpen

AVBR Dropping Switch

Turn on the frame lost mode for completely still pictures, and reduce the bit rate when the pictures are still.

s32AvbrFrmGap

AVBR maximum consecutive frames dropped

Limit the maximum continuous frame loss of AVBR still pictures.

Recommended value: 1

2.4. Macroblock-level Rate Control Parameter Description and Usage

The description of macroblock level rate control parameters is shown in the table below.

Parameter

Description

Suggestions

u32RowQpDelta

Macroblock-level Rate Control Qp Delta Parameter

If the setting is greater than 0, it means that the macroblock-level rate control is used to control the code rate stability.

The Qp delta of the row is not being adjusted significantly at the moment.

Recommended value: 1

s32FirstFrameStartQp

Initial Qp for the First Frame

Set an appropriate start Qp based on the target bit rate resolution scenario.

Recommended value: 36.

The values are as follows:

H.264: 1~51

H.265: 1~51, 63(Internal Decision)

u32ThrdLv

Texture Macroblock-level Rate Auto-control Parameter

The system ADAPTS the threshold level of texture-level bitrate control.

It is used to control the Qp distribution range of intra-frame encoding.

The smaller the value, the smaller the difference between max Qp and min Qp of intra-frame encoding, which can be used to adjust respiration effect and drag problem.

Default value: 2.

The value ranges from 0 to 4

2.5. Frame Dropping Parameter and Usage Instructions for High Bitrate Encoding

Frame dropping parameters for high bitrate encoding are shown in the table below.

Parameter

Description

Suggestions

bFrmLostOpen

Rate Overshoot Frame Dropping Switch

When the bit rate exceeds the threshold, frame loss is enabled to ensure that the peak of the interval bit rate is not too high.

u32FrmLostBpsThr

Rate Overshoot Frame Dropping Threshold

Set according to the system capacity.

It is recommended to set to at least 1.2 times the code rate.

enFrmLostMode

Frame Dropping Mode Selection

Only PSkip frame loss mode is supported.

u32EncFrmGaps

Maximum Consecutive Frame Dropping Count

Limiting the maximum number of consecutive frame loss can make the picture smoother during frame loss period, and the interval of rate spike may be higher.

Value set to 0 means that the number of consecutive frames is not limited.