VideoEncoderConfiguration
Configuration for 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) of the video encoding. See VideoDimensions. This parameter is used to measure encoding quality, represented as height × width. Default is 960 × 540. You can customize the resolution.
- codecType
- Video codec type. See VideoCodecType.
- frameRate
- Frame rate (fps) of the video encoding. Default is 15. See FrameRate.
- bitrate
- Bitrate of the video encoding in Kbps. You do not need to set this parameter; keep the default value
STANDARD_BITRATE. The SDK automatically matches the optimal bitrate based on your configured resolution and frame rate. For the mapping between resolution and frame rate, see Video Profile.- STANDARD_BITRATE (0): (Default) Standard bitrate mode.
- COMPATIBLE_BITRATE (-1): Compatible bitrate mode. In general, we recommend not using this value.
- minBitrate
- Minimum encoding bitrate in Kbps.
The SDK adjusts the video encoding bitrate automatically based on network conditions. Setting this parameter higher than the default forces the encoder to output high-quality images, but may cause packet loss and stuttering under poor network conditions. Therefore, unless you have special quality requirements, we recommend not changing this value.
Note: (Live streaming only)
- orientationMode
- Orientation mode of the video encoding. See OrientationMode.
- degradationPreference
- Video degradation preference when bandwidth is limited. See DegradationPreference.
Note: When this parameter is set to MaintainFramerate (1) or MaintainBalanced (2), you must also set
orientationModeto 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.