功能簡介
在音視訊通信中,根據您的喜好和實際情況設定視訊屬性,調整視訊畫面的清晰度和流暢度。如果是一對一視訊通信,您可以将分辨率和幀率調高,如果頻道内有多個使用者進行視訊通信,您可以将分辨率和碼率适當調低,以減少編解碼的資源消耗和緩解下行帶寬壓力。視訊屬性包含視訊流規格、視訊流類型。
視訊流規格如下表所示。
枚舉名 | 描述 |
AliRtcVideoProfile_Default | 預設,分辨率 480*640,幀率 15 |
AliRtcVideoProfile_180_240P_15 | 分辨率 180*240,幀率 15 |
AliRtcVideoProfile_180_320P_15 | 分辨率 180*320,幀率 15 |
AliRtcVideoProfile_180_320P_30 | 分辨率 180*320,幀率 30 |
AliRtcVideoProfile_240_320P_15 | 分辨率 240*320,幀率 15 |
AliRtcVideoProfile_360_480P_15 | 分辨率 360*480,幀率 15 |
AliRtcVideoProfile_360_480P_30 | 分辨率 360*480,幀率 30 |
AliRtcVideoProfile_360_640P_15 | 分辨率 360*640,幀率 15 |
AliRtcVideoProfile_360_640P_30 | 分辨率 360*640,幀率 30 |
AliRtcVideoProfile_480_640P_15 | 分辨率 480*640,幀率 15 |
AliRtcVideoProfile_480_640P_30 | 分辨率 480*640,幀率 30 |
AliRtcVideoProfile_720_960P_15 | 分辨率 720*960,幀率 15 |
AliRtcVideoProfile_720_960P_30 | 分辨率 720*960,幀率 30 |
AliRtcVideoProfile_720_1280P_15 | 分辨率 720*1280,幀率 15 |
AliRtcVideoProfile_720_1280P_30 | 分辨率 720*1280,幀率 30 |
AliRtcVideoProfile_1080_1920P_15 | 分辨率 1080*1920,幀率 15 |
AliRtcVideoProfile_1080_1920P_30 | 分辨率 1080*1920,幀率 30 |
AliRtcVideoProfile_480_640P_15_1500Kb | 分辨率 480*640,幀率 15,1500Kb 碼率 |
AliRtcVideoProfile_900_1600P_20 | 分辨率 900*1600,幀率 20 |
AliRtcVideoProfile_360_640P_15_800Kb | 分辨率 360*640,幀率 15,800Kb 碼率 |
AliRtcVideoProfile_480_840P_15_500Kb | 分辨率 480*840,幀率 15,500Kb 碼率 |
AliRtcVideoProfile_480_840P_15_800Kb | 分辨率 480*840,幀率 15,800Kb 碼率 |
AliRtcVideoProfile_540_960P_15_800Kb | 分辨率 540*960,幀率 15,800Kb 碼率 |
AliRtcVideoProfile_540_960P_15_1200Kb | 分辨率 540*960,幀率 15,1200Kb 碼率 |
AliRtcVideoProfile_Max | 占位值 |
視訊流類型如下表所示。
AliRtcVideoTrackNo | 無攝像頭和螢幕共享流 |
AliRtcVideoTrackCamera | 相機流 |
AliRtcVideoTrackScreen | 螢幕共享流 |
AliRtcVideoTrackBoth | 相機流和螢幕共享流 |
實作方法
在實作該功能之前,需要您已經搭建 AppServer、實作基本功能等操作。詳情請參見
入門概述。
阿裡雲 RTC SDK 通過 setVideoProfile 方法設定視訊屬性。
- (void)setVideoProfile:(AliRtcVideoProfile)profile forTrack:(AliRtcVideoTrack)track;
參數 | 類型 | |
profile | AliRtcVideoProfile | 視訊流參數。 |
track | AliRtcVideoTrack | 需要設定的視訊 Track 類型。 |
獲得更多功能實作方法,請參見
AliRtcEngine 接口「視訊雲技術」你最值得關注的音視訊技術公衆号,每周推送來自阿裡雲一線的實踐技術文章,在這裡與音視訊領域一流工程師交流切磋。
