VideoEncoderConfiguration

Video encoder configurations.

class VideoEncoderConfiguration {
  const VideoEncoderConfiguration(
      {this.codecType,
      this.dimensions,
      this.frameRate,
      this.bitrate,
      this.minBitrate,
      this.orientationMode,
      this.degradationPreference,
      this.mirrorMode,
      this.advanceOptions});

  @JsonKey(name: 'codecType')
  final VideoCodecType? codecType;

  @JsonKey(name: 'dimensions')
  final VideoDimensions? dimensions;

  @JsonKey(name: 'frameRate')
  final int? frameRate;

  @JsonKey(name: 'bitrate')
  final int? bitrate;

  @JsonKey(name: 'minBitrate')
  final int? minBitrate;

  @JsonKey(name: 'orientationMode')
  final OrientationMode? orientationMode;

  @JsonKey(name: 'degradationPreference')
  final DegradationPreference? degradationPreference;

  @JsonKey(name: 'mirrorMode')
  final VideoMirrorModeType? mirrorMode;

  @JsonKey(name: 'advanceOptions')
  final AdvanceOptions? advanceOptions;

  factory VideoEncoderConfiguration.fromJson(Map<String, dynamic> json) =>
      _$VideoEncoderConfigurationFromJson(json);

  Map<String, dynamic> toJson() => _$VideoEncoderConfigurationToJson(this);
}

Attributes

dimensions

The dimensions of the encoded video (px). See VideoDimensions. This parameter measures the video encoding quality in the format of length × width. The default value is 960 × 540. You can set a custom value.

codecType
The codec type of the local video stream. See VideoCodecType.
frameRate
The frame rate (fps) of the encoding video frame. The default value is 15. See FrameRate.
bitrate

The encoding bitrate (Kbps) of the video. This parameter does not need to be set; keeping the default value standardBitrate is sufficient. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you have set. For the correspondence between video resolution, frame rate, and bitrate, please refer to Video profile.

  • standardBitrate(0): (Recommended) Standard bitrate mode.
  • compatibleBitrate(-1): Adaptive bitrate mode. In general, Agora suggests that you do not use this value.
minBitrate

The minimum encoding bitrate (Kbps) of the video.

The SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and sacrifice the smoothness of the video transmission. Unless you have special requirements for image quality, Agora does not recommend changing this value.

Attention: This parameter only applies to the interactive streaming profile.
orientationMode
The orientation mode of the encoded video. See OrientationMode.
degradationPreference
Video degradation preference under limited bandwidth. See DegradationPreference.
mirrorMode

Sets the mirror mode of the published local video stream. It only affects the video that the remote user sees. See VideoMirrorModeType.

Attention: By default, the video is not mirrored.
advanceOptions
Advanced options for video encoding. See AdvanceOptions.