VideoCaptureParameters

The video configuration for the shared screen stream.

  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;

    @CalledByNative("VideoCaptureParameters")
    public int getBitrate() {
      return bitrate;
    }

    @CalledByNative("VideoCaptureParameters")
    public int getFramerate() {
      return framerate;
    }

    @CalledByNative("VideoCaptureParameters")
    public int getWidth() {
      return width;
    }

    @CalledByNative("VideoCaptureParameters")
    public int getHeight() {
      return height;
    }

    @CalledByNative("VideoCaptureParameters")
    public int getContentHint() {
      return contentHint;
    }

    @Override
    public String toString() {
      return "VideoCaptureParameters{"
          + "bitrate=" + bitrate + ", framerate=" + framerate + ", width=" + width
          + ", height=" + height + ", contentHint=" + contentHint + '}';
    }
  }

Only available for scenarios where captureVideo is true.

Attributes

width
The width (px) of the video encoding resolution. The default value is 1280. If the aspect ratio of width to height is different from that of the screen, the SDK adjusts the video encoding resolution according to the following rules (take width × height of 1280 × 720 as an example):
  • When the width and height of the screen are both lower than those of dimensions, the SDK uses the resolution of the screen for video encoding. For example, if the screen is 640 × 360, the SDK uses 640 × 360 for video encoding.
  • When either the width or height of the screen is higher than that of dimensions, the SDK uses the maximum values that do not exceed those of dimensions while maintaining the aspect ratio of the screen for video encoding. For example, if the screen is 2000 × 1500, the SDK uses 960 × 720 for video encoding.
Note:
  • The billing for the screen sharing stream is based on the value of dimensions. When you do not pass in a value, Agora bills you at 1280 × 720; when you pass in a value, Agora bills you at that value.
  • The value of this parameter does not indicate the orientation mode of the output video. For how to set the video orientation, see ORIENTATION_MODE.
  • Whether the 720p resolution or above can be supported depends on the device. If the device cannot support 720p, the frame rate will be lower than the set value.
Note: When setting the encoding resolution in the scenario of sharing documents (SCREEN_SCENARIO_DOCUMENT), choose one of the following two methods:
  • If you require the best image quality, it is recommended to set the encoding resolution to be the same as the capture resolution.
  • If you wish to achieve a relative balance between image quality, bandwidth, and system performance, then:
    • When the capture resolution is greater than 1920 × 1080, it is recommended that the encoding resolution is not less than 1920 × 1080.
    • When the capture resolution is less than 1920 × 1080, it is recommended that the encoding resolution is not less than 1280 × 720.
height
The height (px) of the video encoding resolution. The default value is 720. If the aspect ratio of width to height is different from that of the screen, the SDK adjusts the video encoding resolution according to the following rules (take width × height of 1280 × 720 as an example):
  • When the width and height of the screen are both lower than those of dimensions, the SDK uses the resolution of the screen for video encoding. For example, if the screen is 640 × 360, the SDK uses 640 × 360 for video encoding.
  • When either the width or height of the screen is higher than that of dimensions, the SDK uses the maximum values that do not exceed those of dimensions while maintaining the aspect ratio of the screen for video encoding. For example, if the screen is 2000 × 1500, the SDK uses 960 × 720 for video encoding.
Note:
  • The billing for the screen sharing stream is based on the value of dimensions. When you do not pass in a value, Agora bills you at 1280 × 720; when you pass in a value, Agora bills you at that value.
  • The value of this parameter does not indicate the orientation mode of the output video. For how to set the video orientation, see ORIENTATION_MODE.
  • Whether the 720p resolution or above can be supported depends on the device. If the device cannot support 720p, the frame rate will be lower than the set value.
Note: When setting the encoding resolution in the scenario of sharing documents (SCREEN_SCENARIO_DOCUMENT), choose one of the following two methods:
  • If you require the best image quality, it is recommended to set the encoding resolution to be the same as the capture resolution.
  • If you wish to achieve a relative balance between image quality, bandwidth, and system performance, then:
    • When the capture resolution is greater than 1920 × 1080, it is recommended that the encoding resolution is not less than 1920 × 1080.
    • When the capture resolution is less than 1920 × 1080, it is recommended that the encoding resolution is not less than 1280 × 720.
frameRate
The video encoding frame rate (fps). The default value is 15.
bitrate
The video encoding bitrate (Kbps).
contentHint
The content hint for screen sharing.
  • SCREEN_CAPTURE_CONTENT_HINT_NONE(0): (Default) No content hint.
  • SCREEN_CAPTURE_CONTENT_HINT_MOTION(1): Motion-intensive content. Choose this option if you prefer smoothness or when you are sharing a video clip, movie, or video game.
  • SCREEN_CAPTURE_CONTENT_HINT_DETAILS(2): Motionless content. Choose this option if you prefer sharpness or when you are sharing a picture, PowerPoint slides, or texts.