Skip to main content

You are viewing Agora Docs forBetaproducts and features. Switch to Docs

You are looking at Interactive Live Streaming v3.x Docs. The newest version is  Interactive Live Streaming 4.x

Android
iOS
macOS
Windows C++
Windows C#
Unity
Flutter
React Native
Electron
Cocos Creator
Cocos2d-x

Set Video Profiles for Screen-Sharing a Game

Overview

Players often need to share their screens during game streaming. This article introduces how to adjust the frame rate, resolution, and bitrate when screen-sharing a game to improve the audience's viewing experience.

Implementation

On Android and iOS platforms, Agora recommends that you do the following to share games by screen sharing.

  • If you are using an SDK earlier than v3.7.0, Agora recommends that you use two processes: one for the video stream captured by the user’s camera, and one for the screen-sharing video stream. Call setVideoEncoderConfiguration to set the video encoding profile of the screen-sharing stream.
  • If you are using the SDK v3.7.0 or later, Agora recommends that you call startScreenCapture to start screen sharing and use ScreenCaptureParameters to set the video encoding profile of the screen-sharing stream.

For details, see Share the Screen (Android) and Share the Screen (iOS).

The optimal video profile varies according to the gaming scenario. The overarching principle is as follows:

  • Adjust the frame rate based on how frequently the images refresh on the screen.
  • Adjust the resolution based on the richness of detail in the images.
  • Adjust the bitrate to accommodate the increase/decrease in the number of pixels caused by the increase/decrease of the frame rate and resolution.

Use the following diagram to determine your gaming scenario, then refer to the scenarios table for suggested video profile settings.

1608803515066

Category Quality level Frame rate (fps) Resolution Bitrate (Kbps)
Scenario 1: Ultra-high image-refresh frequency Smooth 24 640 × 360 1800 ~ 2200
High-definition 24 840 × 480 2600 ~ 2800
Scenario 2: Low image-refresh frequency Smooth 10 840 × 480 800
High-definition 10 1280 × 720 1400
Scenario 3: High image-refresh frequency, high frame rate Smooth 24 840 × 480 1400 ~ 1600
High-definition 24 1280 × 720 2000 ~ 2200
Scenario 4: High image-refresh frequency, low frame rate, and rich image detail Smooth 15 840 × 480 1000 ~ 1200
High-definition 15 1280 × 720 1600 ~ 1800
Scenario 5: High image-refresh frequency, low frame rate, and low image detail Smooth 15 640 × 360 800 ~ 1000
High-definition 15 840 × 480 1400 ~ 1600

Scenario 1: Ultra-high image-refresh frequency

Typical examples include running games, such as Temple Run and Subway Surfers, and racing games. These games require the highest frame rates, such as 24 fps.

Scenario 2: Low image-refresh frequency

Typical examples include Angry Birds and Snake. These games do not require high frame rates, so you can use a lower setting, such as 10 fps. If video profiles at the smooth quality level fail to display the full gaming screen, switch to the high-definition quality level.

Scenario 3: High image-refresh frequency, high frame rate

Typical examples include gun games, such as Game for Peace. These games require a higher frame rate and resolution, such as 24 fps and 1280 × 720, because their images tend to be rich in detail.

Scenario 4: High image-refresh frequency, low frame rate, and rich image detail

Typical examples include MOBA games, such as Honor of Kings. These games do not require the highest frame rates but do require higher resolutions. A typical setting might be 15 fps and 1280 × 720.

Scenario 5: High image-refresh frequency, low frame rate, and low image detail

Typical examples include tower defense games, such as Plants vs. Zombies, and fishing games. These games do not require the highest frame rates or higher resolutions. A typical setting might be 15 fps and 840 × 480.

Considerations

  • You can make minor adjustments to the recommended video profiles according to the actual performance you experience. Agora recommends that you determine the optimal frame rate first, then work out the optimal resolution and bitrate.
  • In scenario 1, a frame rate of 24 fps is enough to screen-share with decent quality. Agora does not recommend setting the value higher than 24 fps, because when the bitrate is fixed, the encoder reduces image quality to reach a higher frame rate. If the 24 fps setting causes overheating or is too resource-intensive, you can adjust the value downward.
  • To ensure that the rich detail of images is displayed in scenarios 3 and 4, Agora recommends setting the resolution as 1280 × 720. You can adjust the resolution and bitrate downward according to the actual performance.

Interactive Live Streaming