ScreenCaptureParameters
Configuration parameters for screen sharing.
public class ScreenCaptureParameters
{
public ScreenCaptureParameters()
{
dimensions = new VideoDimensions(1920, 1080);
frameRate = 5;
bitrate = (int)BITRATE.STANDARD_BITRATE;
captureMouseCursor = true;
windowFocus = false;
excludeWindowList = new view_t[0];
excludeWindowCount = 0;
highLightWidth = 0;
highLightColor = 0;
enableHighLight = false;
}
public ScreenCaptureParameters(ref VideoDimensions d, int f, int b)
{
dimensions = new VideoDimensions(d.width, d.height);
frameRate = f;
bitrate = b;
captureMouseCursor = true;
windowFocus = false;
excludeWindowList = new view_t[0];
excludeWindowCount = 0;
highLightWidth = 0;
highLightColor = 0;
enableHighLight = false;
}
public ScreenCaptureParameters(int width, int height, int f, int b)
{
dimensions = new VideoDimensions(width, height);
frameRate = f;
bitrate = b;
captureMouseCursor = true;
windowFocus = false;
excludeWindowList = new view_t[0];
excludeWindowCount = 0;
highLightWidth = 0;
highLightColor = 0;
enableHighLight = false;
}
public ScreenCaptureParameters(int width, int height, int f, int b, bool cur, bool fcs)
{
dimensions = new VideoDimensions(width, height);
frameRate = f;
bitrate = b;
captureMouseCursor = cur;
windowFocus = fcs;
excludeWindowList = new view_t[0];
excludeWindowCount = 0;
highLightWidth = 0;
highLightColor = 0;
enableHighLight = false;
}
public ScreenCaptureParameters(int width, int height, int f, int b, view_t[] ex, int cnt)
{
dimensions = new VideoDimensions(width, height);
frameRate = f;
bitrate = b;
captureMouseCursor = true;
windowFocus = false;
excludeWindowList = ex;
excludeWindowCount = cnt;
highLightWidth = 0;
highLightColor = 0;
enableHighLight = false;
}
public ScreenCaptureParameters(int width, int height, int f, int b, bool cur, bool fcs, view_t[] ex, int cnt)
{
dimensions = new VideoDimensions(width, height);
frameRate = f;
bitrate = b;
captureMouseCursor = cur;
windowFocus = fcs;
excludeWindowList = ex;
excludeWindowCount = cnt;
highLightWidth = 0;
highLightColor = 0;
enableHighLight = false;
}
public VideoDimensions dimensions { set; get; }
public int frameRate { set; get; }
public int bitrate { set; get; }
public bool captureMouseCursor { set; get; }
public bool windowFocus { set; get; }
public view_t[] excludeWindowList { set; get; }
public int excludeWindowCount { set; get; }
public int highLightWidth { set; get; }
public uint highLightColor { set; get; }
public bool enableHighLight { set; get; }
};
Properties
- dimensions
-
Note: When setting the encoding resolution in a document sharing scenario (The video encoding resolution of the screen sharing stream. See VideoDimensions. The default value is 1920 × 1080, i.e., 2073600 pixels. This pixel value is used for billing.When the aspect ratio of the shared screen resolution does not match this setting, the SDK encodes using the following strategy. Suppose
SCREEN_SCENARIO_DOCUMENT), choose one of the following options:- If you want the best image quality, it is recommended to set the encoding resolution equal to the capture resolution.
- If you want a balance between image quality, bandwidth, and system performance:
- When the capture resolution is greater than 1920 × 1080, it is recommended that the encoding resolution is no less than 1920 × 1080.
- When the capture resolution is less than 1920 × 1080, it is recommended that the encoding resolution is no less than 1280 × 720.
dimensionsis set to 1920 × 1080:- If the screen resolution is smaller than
dimensions, e.g., 1000 × 1000, the SDK encodes directly at 1000 × 1000. - If the screen resolution is larger than
dimensions, e.g., 2000 × 1500, the SDK uses the screen resolution's aspect ratio (4:3) to select the maximum resolution withindimensions, i.e., 1440 × 1080.
- frameRate
- On Windows and macOS platforms, specifies the video encoding frame rate of the screen sharing stream. Unit: fps; default is 5. It is recommended not to exceed 15.
- bitrate
- Bitrate of the shared video. On Windows and macOS platforms, specifies the video encoding bitrate of the screen sharing stream. Unit: Kbps; default is 0, which means the SDK calculates a reasonable value based on the current shared screen resolution.
- captureMouseCursor
-
Note: Due to macOS system limitations, setting this parameter to false has no effect when sharing the screen (no effect when sharing a window).Whether to capture the mouse for screen sharing:
- true: (default) capture the mouse.
- false: do not capture the mouse.
- windowFocus
-
Note: Due to macOS system limitations, when setting this member to bring the window to the front, only the main window is brought to the front if the current application has multiple windows.When calling the StartScreenCaptureByWindowId method to share a window, whether to bring the window to the front:
- true: bring the window to the front.
- false: (default) do not bring the window to the front.
- excludeWindowList
- List of IDs of windows to be excluded. When calling StartScreenCaptureByDisplayId to start screen sharing, you can use this parameter to exclude specific windows. You can also dynamically exclude specific windows by using this parameter when calling UpdateScreenCaptureParameters to update the screen sharing configuration.
- enableHighLight
-
Note: When sharing a partial area of a window or screen, if this parameter is set to true, the SDK highlights the entire window or screen.(Applicable only to macOS and Windows) Whether to highlight the shared window or screen:
- true: highlight.
- false: (default) do not highlight.
- highLightColor
- (Applicable only to macOS and Windows)
- On Windows, specifies the highlight ARGB color. Default is 0xFF8CBF26.
- On macOS,
COLOR_CLASSrefers toNSColor.
- highLightWidth
- (Applicable only to macOS and Windows) Width of the highlight border (px). Default is 5. Value range is (0,50].
Note: This parameter only takes effect when
highLightedis set to true. - excludeWindowCount
- Number of windows to be excluded.
Note: On Windows, the maximum value for this parameter is 24. If it exceeds this value, the window exclusion feature becomes ineffective.