Set video encoding properties

更新时间:
复制 MD 格式

The Real-Time Communication (RTC) SDK lets you set video encoding properties. You can adjust these properties for your specific scenario to improve the user experience. This topic describes how to set video encoding properties.

Background information

In Real-Time Communication scenarios, you can set video encoding properties to adjust the definition and smoothness of the video. If your application runs in an environment with excellent network conditions and sufficient computing power, you can increase the resolution and frame rate for a better user experience. If network conditions are poor or computing power is limited, you can lower the resolution and bitrate. This reduces resource consumption for encoding and decoding and eases the load on downstream bandwidth.

Implementation

You can set video encoding properties using the following APIs:

Platform

API for setting video encoding properties

Android

setVideoEncoderConfiguration

iOS

setVideoEncoderConfiguration

Mac

setVideoEncoderConfiguration

Windows

SetVideoEncoderConfiguration

The config parameter:

Parameter

Type

Description

config

RtcEngineVideoEncoderConfiguration

Predefined video encoding properties.

  • dimensions: The video resolution. Default value: [640, 480].

  • frameRate: The video encoding frame rate. Default value: 20.

Notes

  • To improve performance in weak network environments, the RTC SDK supports simulcast. This feature allows on-demand stream ingest. The resolution, bitrate, and quality of the stream are automatically adjusted within a specific range based on network conditions.

  • Similarly, you can use SetScreenShareEncoderConfiguration to set the encoding properties for a screen sharing stream.