Windows

更新时间:
复制 MD 格式

The Real-Time Communication (RTC) software development kit (SDK) lets you set video encoding properties to improve the user experience in different scenarios. This topic describes how to set these properties.

Background information

In Real-Time Communication scenarios, you can set video encoding properties to adjust video definition and smoothness. For one-to-one video calls, you can increase the resolution and frame rate for a better user experience. If multiple users are in a channel, you can lower the resolution and bitrate to reduce resource consumption and downstream bandwidth usage.

Implementation method

The RTC SDK uses the setVideoEncoderConfiguration method to set video encoding properties.

void SetVideoEncoderConfiguration(const AliEngineVideoEncoderConfiguration& config);
NameTypeDescription
configconst AliEngineVideoEncoderConfiguration &Predefined video encoding properties.
  • dimensions: The video resolution. Default value: (640, 480).
  • frameRate: The video encoding frame rate. Default value: 15.
  • bitrate: The video encoding bitrate. Default value: 512.
  • mirrorMode: The video encoding mirror mode. Default value: 0.
  • orientationMode: The video encoding orientation mode. Default value: 0.
  • rotation: The video encoding rotation angle. Default value: 0.
Note Higher resolutions and frame rates require higher bitrates, which increases device resource consumption and network bandwidth usage. The RTC SDK provides default values for video encoding properties. To customize these properties, see Video resolution, frame rate, and bitrate reference.