Rate This Document
Findability
Accuracy
Completeness
Readability

encodeParams

Variable Description

Encoding parameters.

Variable Data Definition

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
    uint32_t streamWidth = 720;             // Width of the output stream resolution
    uint32_t streamHeight = 1280;           // Height of the output stream resolution
} __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
};

Restrictions

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

Property Field Name

Description

Value Range

Default Value

bitrate

Encoding bit rate.

  • For AMD (usually W6800): 500,000 to 50,000,000
  • For DC1000: 500,000 to 30,000,000

Unit: bit/s

3000000

gopSize

Encoding GOP size.

30 to 3000

30

profile

Encoding profile. (Only main can be used for H.265 encoding.)

  • 0: baseline (supported only in H.264 encoding)
  • 1: main
  • 2: high (supported only in H.264 encoding)

0

rcMode

Bit rate control mode.

  • 0: average bit rate (ABR) (not supported currently)
  • 1: constant rate factor (CRF) (not supported currently)
  • 2: constant bit rate (CBR)
  • 3: capped CRF

2

forceKeyFrame

Forced I-frame encoding.

  • 0: Disable forced I-frame encoding.
  • 1: Forcibly generate an I-frame as the next frame.

0

interpolation

Frame interpolation.

  • false: Disable frame interpolation.
  • true: Enable frame interpolation.

false

crf

CRF bit rate control level.

0 to 51

34

maxCrfRate

Maximum CRF bit rate.

500,000 to 100,000,000

20000000

vbvBufferSize

Size of the CRF bit rate buffer.

  • -1: auto mode.
  • 0: Disable the maximum bit rate restriction.
  • [min_vbv_size, 3000].

    min_vbv_size = ceil(1000/fps) + 1 and min_vbv_size ≥ 10

1000

streamWidth

Output frame width.

[240, cloud phone rendering resolution]. The output frame width must be a multiple of 8.

720

streamHeight

Output frame height.

[240, cloud phone rendering resolution]. The output frame height must be a multiple of 8.

1080

  1. Currently, two options are valid for the rcMode parameter: CBR mode and capped CRF mode. Quadra supports both modes, and DC1000 supports only the CBR mode.
  2. If rcMode is set to CBR, you can use the bitrate variable to specify the constant bit rate. If rcMode is set to capped CRF, use the crf, maxCrfRate, and vbvBufferSize variables to control the bit rate when Quadra is used, or use the crf and maxCrfRate variables to control the bit rate when DC1000 is used.