VideoEncoderConfiguration

Used to configure video encoding parameters.

struct VideoEncoderConfiguration {
  VIDEO_CODEC_TYPE codecType;
  VideoDimensions dimensions;
  int frameRate;
  int bitrate;
  int minBitrate;
  ORIENTATION_MODE orientationMode;
  DEGRADATION_PREFERENCE degradationPreference;
  VIDEO_MIRROR_MODE_TYPE mirrorMode;
  AdvanceOptions advanceOptions;
};

Properties

codecType
Codec type of the local video stream. See VIDEO_CODEC_TYPE.
dimensions
Dimensions of the encoded video (in pixels). This parameter measures video encoding quality in the format width × height. Default is 960 × 540. You can set a custom value. See VideoDimensions.
frameRate
Frame rate (fps) of the encoded video. Default is 15.
bitrate
Bitrate (Kbps) of the encoded video. You do not need to set this parameter; keep the default value STANDARD_BITRATE. The SDK automatically matches the optimal bitrate based on the video resolution and frame rate you set.
  • STANDARD_BITRATE (0): Recommended standard bitrate mode.
  • COMPATIBLE_BITRATE (-1): Adaptive bitrate mode, generally not recommended.
minBitrate
Minimum bitrate (Kbps) of the encoded video. The SDK automatically adjusts the encoding bitrate to adapt to network conditions. Using a value higher than the default forces the video encoder to output high-quality images, which may result in more packet loss and affect video smoothness.
Note: This parameter is only applicable in the interactive live streaming scenario.
orientationMode
Orientation mode of the encoded video. See ORIENTATION_MODE.
degradationPreference
Video encoding degradation preference under limited bandwidth. See DEGRADATION_PREFERENCE.
Note: When this parameter is set to MAINTAIN_FRAMERATE (1) or MAINTAIN_BALANCED (2), orientationMode must also be set to ORIENTATION_MODE_ADAPTIVE (0), otherwise this setting does not take effect.
mirrorMode
Mirror mode when publishing the local video stream. Affects only what remote users see. See VIDEO_MIRROR_MODE_TYPE.
Note: By default, video is not mirrored.
advanceOptions
Advanced options for video encoding. See AdvanceOptions.