VideoEncoderConfiguration

Configuration of the video encoder.

export class VideoEncoderConfiguration {

  codecType?: VideoCodecType;

  dimensions?: VideoDimensions;

  frameRate?: number;

  bitrate?: number;

  minBitrate?: number;

  orientationMode?: OrientationMode;

  degradationPreference?: DegradationPreference;

  mirrorMode?: VideoMirrorModeType;

  advanceOptions?: AdvanceOptions;
}

Properties

dimensions
Resolution (px) for video encoding. See VideoDimensions. This parameter is used to measure encoding quality, expressed as width × height. The default value is 960 × 540. You can set the resolution as needed.
codecType
Video codec type. See VideoCodecType.
frameRate
Frame rate (fps) for video encoding. Default is 15. See FrameRate.
bitrate
Bitrate for video encoding in Kbps. This parameter does not need to be set; keep the default value STANDARD_BITRATE. The SDK automatically matches the optimal bitrate based on your video resolution and frame rate. For details on the relationship between resolution and frame rate, see Video Profile.
  • STANDARD_BITRATE (0): (Default) Standard bitrate mode.
  • COMPATIBLE_BITRATE (-1): Compatible bitrate mode. In general, Agora recommends not using this value.
minBitrate
Minimum encoding bitrate in Kbps. The SDK automatically adjusts the video encoding bitrate based on network conditions. Setting this parameter higher than the default can force the encoder to output higher quality images, but may cause packet loss and stuttering under poor network conditions. Therefore, unless you have special requirements for image quality, Agora recommends not modifying this parameter.
Note: This parameter is only applicable in live streaming scenarios.
orientationMode
Orientation mode for video encoding. See OrientationMode.
degradationPreference
Video encoding degradation preference under limited bandwidth. See DegradationPreference.
Note: When this parameter is set to MaintainFramerate (1) or MaintainBalanced (2), you must also set orientationMode to OrientationModeAdaptive (0), otherwise the setting will not take effect.
mirrorMode
Whether to enable mirror mode when sending encoded video. This only affects the video seen by remote users. See VideoMirrorModeType.
Note: Mirror mode is disabled by default.
advanceOptions
Advanced options for video encoding. See AdvanceOptions.