|
本地上传视频参数设置,可参考AnyChat for Android SDK的标准示例代码,里面的【设置】功能,可以设置视频相关参数(包括分辩率、输出码率等),源代码在:HallActivity.java中的:ApplyVideoConfig()中:- if(configEntity.configMode == 1) // 自定义视频参数配置
- {
- // 设置本地视频编码的码率(如果码率为0,则表示使用质量优先模式)
- AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_LOCALVIDEO_BITRATECTRL, configEntity.videoBitrate);
- if(configEntity.videoBitrate==0)
- {
- // 设置本地视频编码的质量
- AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_LOCALVIDEO_QUALITYCTRL, configEntity.videoQuality);
- }
- // 设置本地视频编码的帧率
- AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_LOCALVIDEO_FPSCTRL, configEntity.videoFps);
- // 设置本地视频编码的关键帧间隔
- AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_LOCALVIDEO_GOPCTRL, configEntity.videoFps*4);
- // 设置本地视频采集分辨率
- AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_LOCALVIDEO_WIDTHCTRL, configEntity.resolution_width);
- AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_LOCALVIDEO_HEIGHTCTRL, configEntity.resolution_height);
- // 设置视频编码预设参数(值越大,编码质量越高,占用CPU资源也会越高)
- AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_LOCALVIDEO_PRESETCTRL, configEntity.videoPreset);
- }
复制代码 |
|