Rate This Document
Findability
Accuracy
Completeness
Readability

Config

Function Usage

Inputs the initial configuration of the encoder. This API needs to be called before InitEncoder.

Restrictions

This parameter passes through the parameters listed in Configuration Parameters to VmiEncoderConfig and VmiEncoderParams. The restrictions on these parameters are still valid.

Prototype

EncoderRetCode Config(const VmiEncoderConfig &config)

Parameter Description

Parameter

Input/Output

Type

Description

config

Input

struct VmiEncoderConfig

Encoder configuration.

Struct declarations of VmiEncoderConfig and VmiEncoderParams are as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
struct VmiEncoderParams {
    uint32_t bitRate = 3000000;
    uint32_t gopSize = 30;
    uint32_t profile = 1;
    uint32_t keyFrame = 0;
    uint32_t rcMode = 2;                        // Rate control mode
    uint32_t crf = 34;                          // CRF bit rate control level
    uint32_t maxCrfRate = 20000000;             // Maximum CRF bit rate
    int32_t vbvBufferSize = 1000;               // Size of the CRF bit rate buffer
};
1
2
3
4
5
6
struct VmiEncoderConfig {
    uint32_t width = 720;
    uint32_t height = 1280;
    uint32_t frameRate = 30;
    VmiEncoderParams encodeParams;
};

Return Value Description

Data type: EncoderRetCode

The value can be any of the following:

VIDEO_ENCODER_SUCCESS: The encoder is successfully configured.