音视频通话

屏幕共享质量配置

功能介绍

通过 setScreenShareCfg 在开始共享时设置分辨率、帧率、码率等参数。配置采用 JSON 格式,参考 ScreenShareCfg。

1. 质量参数

参数 类型 默认值 说明
maxFPS int 12 最大帧率(1~60)
maxKbps int 2000 最大码率 kbit/s(1~4000)
qp int 22 画质(0~51,0 为无损)

2. 配置示例

共享指定屏幕,720p、15 帧:

// monitorID 来自 getScreenCaptureSources 的屏幕 sourceId
ScreenShareCfg *cfg = [[ScreenShareCfg alloc] init];
cfg.monitorID = 0;
cfg.maxFPS = 15;
cfg.maxKbps = 2000;

[[RTCMeeting shareInstance] setScreenShareCfg:cfg];

共享指定窗口:

// catchWnd 来自 getScreenCaptureSources 的窗口 sourceId
ScreenShareCfg *cfg = [[ScreenShareCfg alloc] init];
cfg.catchWnd = 12345678;
cfg.maxFPS = 15;
cfg.maxKbps = 2000;

[[RTCMeeting shareInstance] setScreenShareCfg:cfg];

3. 其它可选参数

参数 说明
borderHighLight 是否对共享源描边高亮,适用窗口共享
highLightColor 共享时描边颜色,如 #54DB00
highLightWidth 描边宽度

4. 相关 API