Rate This Document
Findability
Accuracy
Completeness
Readability

encodeParams

Variable Description

Encoding parameters.

Restrictions

Only the constant bit rate (CBR) and CAPPED_CRF modes are supported in rate control.

Variable Data Definition

struct EncodeParams {
    uint32_t bitrate = 3000000;             // Bit rate
    uint32_t gopSize = 30;                  // I-frame interval
    ProfileType profile = BASELINE;         // Encoding complexity
    RCMode rcMode = CBR;                    // Rate control mode
    uint32_t forceKeyFrame = 0;             // Forcibly generate an I-frame in frame N after the setting. 0 indicates that the setting does not take effect.
    bool interpolation = false;             // Frame interpolation
    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
} __attribute__((packed));

enum ProfileType : uint32_t {
    BASELINE,
    MAIN,
    HIGH
};

enum RCMode : uint32_t  {
    ABR,                       // Average bit rate, not supported currently
    CRF,                       // Constant rate factor, not supported currently
    CBR,                       // Constant bit rate
    CAPPED_CRF,                // Capped CRF
    RC_MODE_MAX
};