Scenario-based Audio and Video Configuration
Feature overview
To facilitate rapid integration for developers and reduce the access threshold, the SDK has condensed various scenario-based configuration solutions through extensive online data verification. Developers can select the corresponding room mode according to the required scenario, and the SDK will automatically apply audio and video codecs, audio and video parameters, flow control strategies, and other configurations suitable for the scenario, thereby quickly achieving the best results in that scenario. Currently supported scenarios include show live streaming, KTV, standard 1v1 audio and video calls, high-quality 1v1 audio and video calls, standard audio chat rooms, and high-quality audio chat rooms.
Usage
In the profile (ZegoEngineProfile) parameter when creating the engine, you need to specify a scenario in the scenario (ZegoScenario) field. You can choose according to the actual audio and video business scenario.
- For users in the same room, it is recommended to use the same room scenario to achieve the best results.
- If your App has multiple audio and video business scenarios, for example, both 1v1 audio and video call scenarios and show live streaming scenarios. You can exit the room without destroying the engine (destroyEngine), then switch scenarios by calling setRoomScenario, and then login to other rooms.
Currently the SDK supports the following scenarios:
| Scenario (Supported version: 3.0.0 and above) | Scenario Description | Key Configuration Description |
|---|---|---|
| Broadcast | Live streaming scenario, suitable for one-to-many live streaming scenarios such as show, gaming, e-commerce, and education large classes. It has optimized audio and video quality, smoothness, and compatibility. Note: In live streaming scenarios, the SDK does not distinguish between business "roles" (such as hosts and viewers), and all users in the room can publish and play streams. |
|
| StandardVideoCall | Standard audio and video call scenario, suitable for 1v1 video or voice call scenarios. |
|
| HighQualityVideoCall | High-quality audio and video call scenario, similar to StandardVideoCall scenario, but this scenario adopts higher video configuration by default than StandardVideoCall scenario, suitable for video call scenarios with higher requirements for picture quality. |
|
| StandardChatroom | Standard audio chat room scenario, suitable for multi-person pure voice calls, saving traffic. Note: On the Video Call (Express-Video) SDK, this scenario does not enable the camera by default.It is recommended to choose the high-quality audio chat room scenario configuration for audio chat room scenarios with music. | Audio encoder compatibility: Only available for RTC publishing stream, server-side transcoding is required when relaying to CDN. |
| HighQualityChatroom | High-quality audio chat room scenario, similar to StandardChatroom scenario, but this scenario adopts higher audio configuration by default than StandardChatroom scenario, suitable for multi-person pure voice call scenarios with higher requirements for audio quality. Note: On the Video Call (Express-Video) SDK, this scenario does not enable the camera by default. | Audio encoder compatibility: Only available for RTC publishing stream, server-side transcoding is required when relaying to CDN. |
| Karaoke | Karaoke (KTV) scenario, suitable for real-time chorus and online K song scenarios. It has optimized latency, audio quality, ear return, echo cancellation, etc., while also ensuring precise alignment and ultra-low latency during multi-person chorus. Note: On the Video Call (Express-Video) SDK, this scenario does not enable the camera by default. | Audio encoder compatibility: Only available for RTC publishing stream, server-side transcoding is required when relaying to CDN. |
| Default | Default (general) scenario. If none of the above scenario enumerations match the developer's actual application scenario, you can use this default scenario. |
|
Since the following 3 old scenarios have been deprecated, users using old scenarios are requested to migrate to the above new scenarios as soon as possible.
- General old general scenario.
- Communication old real-time communication scenario.
- Live old live streaming scenario.
If after specifying a scenario, developers have needs for fine-grained control of SDK audio and video configuration, they can configure through other APIs. The priority is higher than scenario-based configuration. For details, please refer to Common Video Configuration and Traffic Control documents.
-
Video-related configurations
-
Audio-related configurations
-
Audio 3A processing-related configurations
-
Flow control-related configurations
- After logging in to the room, modifying the room scenario is no longer allowed. If you need to switch scenarios, you need to exit the room first. If you have logged in to multiple rooms, you need to exit all rooms before switching scenarios. If you call setRoomScenario while already logged in to a room, the call will be invalid and will callback error code 1000067 through onDebugError.
- After exiting the room, once you switch scenarios through setRoomScenario, all fine-grained configurations of related audio and video previously performed through the above APIs will be reset to the default values of the new scenario. Therefore, it is recommended to set the scenario first, and then adjust the audio and video configuration through other APIs.
- If you have other scenario setting requirements or configuration questions, please contact ZEGO Technical Support.
