setVideoScenario
Sets video application scenarios.
virtual int setVideoScenario(VIDEO_APPLICATION_SCENARIO_TYPE scenarioType) = 0;
Details
- Since
- v4.2.0
After successfully calling this method, the SDK will automatically enable the best practice strategies and adjust key performance metrics based on the specified scenario, to optimize the video experience.
Parameters
- scenarioType
- The type of video application scenario. See VIDEO_APPLICATION_SCENARIO_TYPE.APPLICATION_SCENARIO_MEETING (1) is suitable for meeting scenarios. The SDK automatically enables the following strategies:
- In meeting scenarios where low-quality video streams are required to have a high bitrate, the SDK automatically enables multiple technologies used to deal with network congestions, to enhance the performance of the low-quality streams and to ensure the smooth reception by subscribers.
- The SDK monitors the number of subscribers to the high-quality video stream in real time and dynamically adjusts its configuration based on the number of subscribers.
- If nobody subscribers to the high-quality stream, the SDK automatically reduces its bitrate and frame rate to save upstream bandwidth.
- If someone subscribes to the high-quality stream, the SDK resets the high-quality stream to the VideoEncoderConfiguration configuration used in the most recent calling of setVideoEncoderConfiguration. If no configuration has been set by the user previously, the following values are used:
- Resolution: (Windows and macOS) 1280 × 720; (Android and iOS) 960 × 540
- Frame rate: 15 fps
- Bitrate: (Windows and macOS) 1600 Kbps; (Android and iOS) 1000 Kbps
- The SDK monitors the number of subscribers to the low-quality video stream in real time and dynamically enables or disables it based on the number of subscribers.Note: If the user has called setDualStreamMode [2/2] to set that never send low-quality video stream (DISABLE_SIMULCAST_STREAM), the dynamic adjustment of the low-quality stream in meeting scenarios will not take effect.
- If nobody subscribes to the low-quality stream, the SDK automatically disables it to save upstream bandwidth.
- If someone subscribes to the low-quality stream, the SDK enables the low-quality stream and resets it to the SimulcastStreamConfig configuration used in the most recent calling of setDualStreamMode [2/2]. If no configuration has been set by the user previously, the following values are used:
- Resolution: 480 × 272
- Frame rate: 15 fps
- Bitrate: 500 Kbps
APPLICATION_SCENARIO_1V1(2) This is applicable to the scenario. To meet the requirements for low latency and high-quality video in this scenario, the SDK optimizes its strategies, improving performance in terms of video quality, first frame rendering, latency on mid-to-low-end devices, and smoothness under weak network conditions.
(3) This is applicable to the scenario. In response to the high demands for first-frame rendering time and image quality, the SDK focuses on reducing first-frame rendering time and enhancing overall image quality, even in poor network conditions or on low-end devices.
Returns
- 0: Success.
- < 0: Failure.
- -1: A general error occurs (no specified reason).
- -4: Video application scenarios are not supported. Possible reasons include that you use the Voice SDK instead of the Video SDK.
- -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.