logo
On this page

Scenario-based Audio and Video Configuration


Function Overview

To facilitate quick integration for developers and reduce the integration threshold, the SDK has condensed multiple scenario-based configuration solutions through extensive online data verification. Developers can choose 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 that scenario, thereby quickly achieving the best effect 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 voice chat room, and high-quality voice chat room.

Warning

This feature does not support running in WebGL environment.

Call Method

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.

Warning
  • For users in the same room, it is recommended to use the same room scenario to obtain the best effect.
  • If your App has multiple audio and video business scenarios, for example, both 1v1 audio and video call scenario and show live streaming scenario. You can switch scenarios by calling SetRoomScenario after exiting the room without destroying the engine (DestroyEngine), and then log in to other rooms.

Currently, the SDK supports the following scenarios:

Scenario (Supported version: 3.0.0 and above)Scenario DescriptionKey Configuration Description
Broadcast

Live streaming scenario, suitable for one-to-many live streaming scenarios such as shows, gaming, e-commerce, education large classes, etc. Optimized for audio and video quality, smoothness, compatibility, etc.

Note: In the live streaming scenario, the SDK has no business "role" distinction (such as hosts, audience), and all users in the room can publish and play streams.

  • Resolution: 540p.
  • Frame rate: 24 fps.
  • Audio encoder compatibility: Server-side transcoding is required when interoperating with Web SDK.
StandardVideoCall

Standard audio and video call scenario, suitable for 1v1 video or voice call scenarios.

  • Resolution: 360p.
  • Frame rate: 15 fps.
  • Audio encoder compatibility: Only available for RTC publishing stream, server-side transcoding is required when relaying to CDN.
HighQualityVideoCall

High-quality audio and video call scenario, similar to the StandardVideoCall scenario, but this scenario uses higher video configuration than the StandardVideoCall scenario by default, suitable for video call scenarios with higher requirements for video quality.

  • Resolution: 540p.
  • Frame rate: 24 fps.
  • Audio encoder compatibility: Only available for RTC publishing stream, server-side transcoding is required when relaying to CDN.
StandardVoiceCall

Standard voice call scenario, suitable for 1v1 pure voice call scenarios.

Note: On the Video Call (Express-Video) SDK, this scenario does not enable the camera by default.

-
StandardChatroom

Standard voice 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 voice chat room scenario configuration for voice 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 voice chat room scenario, similar to the StandardChatroom scenario, but this scenario uses higher audio configuration than the StandardChatroom scenario by default, 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, online K song scenarios, optimized for latency, audio quality, headphone monitor, echo cancellation, etc., while also ensuring precise alignment and ultra-low latency for 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, this default scenario can be used.

  • Resolution: 360p.
  • Frame rate: 15 fps.
  • Audio encoder compatibility: Server-side transcoding is required when interoperating with Web SDK.
Warning

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 requirements for fine-grained control of SDK audio and video configuration, they can configure through other APIs, which have higher priority than scenario-based configuration. For details, please refer to the Flow Control documentation.

Warning
  • After logging in to the room, modifying the room scenario is no longer allowed. 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 SetRoomScenario is called while already logged in to a room, the call will be invalid and will trigger error code 1000067 through the OnDebugError callback.
  • After exiting the room, once you switch scenarios through SetRoomScenario, all related audio and video fine-grained configurations previously made 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 ZEGOCLOUD Technical Support.

Previous

Quick Implement Live Streaming

Next

Use Token Authentication

On this page

Back to top