实时音视频 SPARKRTC-本地流对象(LocalStream):setScreenProfile

时间:2024-03-25 20:33:11

setScreenProfile

setScreenProfile(profile: string|RTCScreenProfile): void

功能说明

设置辅流配置,包括分辨率、帧率和码率等。如果未调用该接口设置,则SDK设置默认值为720p。

请求参数

profile:必选,string类型或RTCScreenProfile类型。若为string类型,则相关分辨率、帧率、码率如表4所示。如果为RTCScreenProfile,则需要根据实际情况进行配置,推荐使用已定义的“profile”。输入不合法时,默认使用720p。

表4 profile对应的分辨率、帧率和码率

profile

分辨率

帧率

码率(kbps)

720p

1280 x 720

15

1200

1080p

1920 x 1080

15

2000

RTCScreenProfile类型为: {

  • width:可选,number类型,分辨率的宽度,单位为像素。
  • height:可选,number类型,分辨率的高度,单位为像素。
  • frameRate:可选,number类型,视频帧率,单位为帧/秒。
  • bitrate:可选,number类型,视频码率,单位为bps。

}

返回参数

该方法需要在调用initialize之前调用。

需注意码表中单位为kbps,接口传参的单位为bps,实际调用接口时需进行转换。

support.huaweicloud.com/csdk-rtc/rtc_05_0141.html