VideoEncodeConfig
Parameter |
Type |
Description |
|---|---|---|
width |
int |
Width of the encoded video frame data. The default value is 1920. The value must be the same as the width (original_width) of the image to be encoded.
|
height |
int |
Height of the encoded video frame data. The default value is 1080. The value must be the same as the height (original_height) of the image to be encoded.
|
outputVideoFormat |
StreamFormat enumeration |
Encoded output video format. H.264 videos support base.h264_baseline_level, base.h264_main_level (default), and base.h264_high_level. H.265 videos support only base.h265_main_level. |
inputImageFormat |
image_format enumeration |
Input image format. Only base.nv12 (default) and base.nv21 are supported. |
keyFrameInterval |
int |
I-frame interval. The default value is 30.
|
srcRate |
int |
Frame rate of input streams, in fps. The default value is 30.
|
rcMode |
int |
|
shortTermStatsTime |
int |
Short-term statistical time of the bit rate, in seconds. The value range is [1, 120]. The default value is 60. This parameter takes effect only when rcMode is set to 5 on Atlas inference product. |
longTermStatsTime |
int |
Long-term statistical time of the bit rate, in minutes. The value range is [1, 1440]. The default value is 120. This parameter takes effect only when rcMode is set to 5 on Atlas inference product. |
longTermMaxBitRate |
int |
Maximum long-term output bit rate of the encoder, in kbps. The default value is 300. Value range: [2, maxBitRate]. This parameter takes effect only when rcMode is set to 5 on Atlas inference product. |
longTermMinBitRate |
int |
Minimum long-term output bit rate of the encoder, in kbps. The default value is 0. Value range: [0, longTermMaxBitRate]. This parameter takes effect only when rcMode is set to 5 on Atlas inference product. |
maxBitRate |
int |
Output bit rate, in kbps. The default value is 300.
|
ipProp |
int |
I-frame to P-frame bit allocation ratio within a GOP. The value range is [1, 100]. The default value is 70. |
sceneMode |
int |
Scene mode.
This parameter takes effect only on Atlas inference product. NOTE:
When the output video format is set to H.264 and sceneMode is set to 1, the value of sceneMode is automatically switched to 0 because H.264 does not support motion scenes where the bit rate is high. |
displayRate |
int |
Frame rate for playing the output video. The value range is [1, 120]. The default value is 30. This parameter takes effect only on Atlas inference product. |
statsTime |
int |
Bit rate statistical time, in seconds. The value range is [1, 60]. The default value is 1. This parameter takes effect only on Atlas inference product. |
firstFrameStartQp |
int |
Start QP value of the first frame. The value range is [0, 47]. The default value is 32. This parameter takes effect only on Atlas inference product. |
SetThresholdI |
func |
MADi threshold for the macroblock-level bit rate of I-frames, used to measure the spatial texture complexity of the current frame. For details about the parameters, see SetThresholdI Description. This parameter takes effect only on Atlas inference product. |
SetThresholdP |
func |
MADi threshold for the macroblock-level bit rate of P-frames, used to measure the spatial texture complexity of the current frame. For details about the parameters, see SetThresholdP Description. This parameter takes effect only on Atlas inference product. |
SetThresholdB |
func |
MADi threshold for the macroblock-level bit rate of B-frames, used to measure the spatial texture complexity of the current frame. For details about the parameters, see SetThresholdB Description. This parameter takes effect only on Atlas inference product. |
direction |
int |
Addition or subtraction direction control during texture-based macroblock-level bit rate control The value range is [0, 16]. The default value is 8. This parameter takes effect only on Atlas inference product. |
rowQpDelta |
int |
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 image complexity is unevenly distributed, the image quality may be uneven if the value of this parameter is too large. The value range is [0, 10]. The default value is 1. If the value is set to 0, row-based macroblock-level bit rate control is disabled. This parameter takes effect only on Atlas inference product. |
SetThresholdI Description
Parameter |
Type |
Description |
|---|---|---|
threshold_i |
list |
Value range of list: [0, 255]. If you do not use it to set the value of thresholdI, the default value of thresholdI is [0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255]. 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. |
SetThresholdP Description
Parameter |
Type |
Description |
|---|---|---|
threshold_p |
list |
Value range of list: [0, 255]. If you do not use it to set the value of thresholdP, the default value of thresholdP is [0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255]. 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. |
SetThresholdB Description
Parameter |
Type |
Description |
|---|---|---|
threshold_b |
list |
Value range of list: [0, 255]. If you do not use it to set the value of thresholdB, the default value of thresholdB is [0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255]. 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. |
Recommended Configuration
The following table lists the recommended parameter settings that ensure good video encoding quality during video capture. In other scenarios, adjust the parameter settings as required.
Image Quality/Resolution |
srcRate |
keyFrameInterval |
maxBitRate |
|---|---|---|---|
4K 3840 × 2160/4096 × 2160 |
25 or 30 |
50 or 60 |
|
2K 2560 × 1440 |
25 or 30 |
50 or 60 |
|
1080p (Blu-ray) 1920 × 1080 |
25 or 30 |
50 or 60 |
|
720p (HD) 1280 × 720 |
25 or 30 |
50 or 60 |
|
480p/D1_N (SD) 854 × 480/720 × 480 |
25 or 30 |
50 or 60 |
|
576P/D1 (SD) 720 × 576 |
25 or 30 |
50 or 60 |
|
270p (smooth) 480 × 270 |
25 or 30 |
50 or 60 |
- |
CIF P/N 352 × 288/320 × 240 |
25 or 30 |
50 or 60 |
|