VideoCaptureParameters
Configures video parameters for screen sharing.
public static class VideoCaptureParameters {
public int bitrate = 0;
public int framerate = 15;
public int width = 1280;
public int height = 720;
public int contentHint = Constants.SCREEN_CAPTURE_CONTENT_HINT_MOTION;
}
- Since
- Available since v3.7.0.
Only available when the captureVideo parameter is set to true.
Properties
- bitrate
- Video encoding bitrate (Kbps).
- framerate
- Video encoding frame rate (fps). Default is 15.
- width
-
Note: Billing for screen sharing stream is based on this parameter. If not specified, Agora charges based on 1280 × 720; if specified, charges are based on the set value. This parameter does not indicate the rotation of the output video. For rotation settings, see ORIENTATION_MODE. Support for 720p or higher resolution depends on device performance. If unsupported, the frame rate may be lower than the set value. When setting encoding resolution in theWidth of the video encoding resolution (px). Default is 1280. If the aspect ratio differs from the screen, the SDK adjusts it as follows, using 1280 × 720 as an example:
SCREEN_SCENARIO_DOCUMENTscenario, the following is recommended:- For best image quality: Set encoding resolution equal to capture resolution.
- To balance quality, bandwidth, and performance:
- If capture resolution > 1920 × 1080, encoding resolution should be ≥ 1920 × 1080.
- If capture resolution < 1920 × 1080, encoding resolution should be ≥ 1280 × 720.
- If both screen width and height are smaller than the set values, the original screen resolution is used. For example, if the screen is 640 × 360, the encoding resolution is 640 × 360.
- If either screen width or height exceeds the set values, the SDK adjusts the resolution proportionally within the set limits. For example, if the screen is 2000 × 1500, the encoding resolution is 960 × 720.
- height
-
Note: Billing for screen sharing stream is based on this parameter. If not specified, Agora charges based on 1280 × 720; if specified, charges are based on the set value. This parameter does not indicate the rotation of the output video. For rotation settings, see ORIENTATION_MODE. Support for 720p or higher resolution depends on device performance. If unsupported, the frame rate may be lower than the set value. When setting encoding resolution in theHeight of the video encoding resolution (px). Default is 720. If the aspect ratio differs from the screen, the SDK adjusts it as follows, using 1280 × 720 as an example:
SCREEN_SCENARIO_DOCUMENTscenario, the following is recommended:- For best image quality: Set encoding resolution equal to capture resolution.
- To balance quality, bandwidth, and performance:
- If capture resolution > 1920 × 1080, encoding resolution should be ≥ 1920 × 1080.
- If capture resolution < 1920 × 1080, encoding resolution should be ≥ 1280 × 720.
- If both screen width and height are smaller than the set values, the original screen resolution is used. For example, if the screen is 640 × 360, the encoding resolution is 640 × 360.
- If either screen width or height exceeds the set values, the SDK adjusts the resolution proportionally within the set limits. For example, if the screen is 2000 × 1500, the encoding resolution is 960 × 720.
- contentHint
- Content hint options for screen sharing:
SCREEN_CAPTURE_CONTENT_HINT_NONE(0): Default, no content hint.SCREEN_CAPTURE_CONTENT_HINT_MOTION(1): Motion content, suitable for smoothness or sharing movies, videos, and games.SCREEN_CAPTURE_CONTENT_HINT_DETAILS(2): Static content, suitable for clarity or sharing images, PPTs, or text.