iOS and macOS

更新时间:
复制 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

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

- (void)setVideoEncoderConfiguration:(AliRtcVideoEncoderConfiguration* _Nonnull)config;
NameTypeDescription
configAliRtcVideoEncoderConfiguration* _NonnullPredefined 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: 0.
  • 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 to achieve the desired video definition and smoothness. This 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.
  • To maintain call performance in weak network conditions, the RTC SDK can monitor network changes. It can adjust the main video stream specifications, prioritize subscribing to the remote low-quality stream, or publish only the audio stream to ensure a basic call experience. For more information, see Network environment monitoring and weak network policies and Dual-stream video specifications.