VideoEncodeConfig
Function
Stores video encoding parameters.
Structure Definition
struct VideoEncodeConfig {
uint32_t width = 1920;
uint32_t height = 1080;
// stream format renference acldvppStreamFormat
StreamFormat outputVideoFormat = StreamFormat::H264_MAIN_LEVEL;
// output format renference acldvppPixelFormat
ImageFormat inputImageFormat = ImageFormat::YUV_SP_420;
VideoEncodeCallBack callbackFunc = nullptr;
uint32_t keyFrameInterval = 30;
uint32_t srcRate = 30;
uint32_t rcMode = 0;
uint32_t maxBitRate = 300;
uint32_t ipProp = 70;
};
Parameter Description
Parameter |
Description |
|---|---|
width |
Width of the encoded video frame data. The value must be the same as the width of the image to be encoded (originalSize) and defaults to 1920.
|
height |
Height of the encoded video frame data. The value must be the same as the height of the image to be encoded (originalSize) and defaults to 1080.
|
outputVideoFormat |
Output video format after encoding. The default value is StreamFormat::H264_MAIN_LEVEL. |
inputImageFormat |
Supported input image format: YUV_SP_420 (default) and YVU_SP_420 |
callbackFunc |
Callback function after encoding. It cannot be a null pointer. |
keyFrameInterval |
Video I-frame interval. The value ranges from 1 to 2000 and defaults to 30. |
srcRate |
Frame rate of input streams, in fps. The default value is 30.
|
rcMode |
Bit rate control mode. The values are as follows:
|
maxBitRate |
Output bit rate, in kbit/s. The default value is 300.
|
ipProp |
I-frame to P-frame bit allocation ratio within a GOP. The value ranges from 1 to 100 and defaults to 70. |
Recommended Configuration
The following table lists the recommended parameter settings that ensure good video encoding quality during video collection. In other scenarios, adjust the parameter settings as required.
Picture Quality/Resolution |
srcRate |
keyFrameInterval |
maxBitRate |
|---|---|---|---|
4K 3840 * 2160/4096 * 2160 |
25 or 30 |
50 or 60 |
|
2K 2560 x 1440 |
25 or 30 |
50 or 60 |
|
1080p (Blu-ray) 1920 x 1080 |
25 or 30 |
50 or 60 |
|
720p (HD) 1280 x 720 |
25 or 30 |
50 or 60 |
|
480p/D1_N (SD) 854 x 480/720 x 480 |
25 or 30 |
50 or 60 |
|
576P/D1 (SD) 720 x 576 |
25 or 30 |
50 or 60 |
|
270p (smooth) 480 x 270 |
25 or 30 |
50 or 60 |
- |
CIF P/N 352 x 288/320 x 240 |
25 or 30 |
50 or 60 |
|