我们有一个使用QuickBlox视频聊天的iOS项目。基于他们给出的示例应用程序,我们能够成功实现它。当我们测试它时,质量看起来有点糟糕。有谁知道如何提高视频聊天的质量?
感谢。
答案 0 :(得分:2)
您可以通过在videoChatConfiguration中设置kQBVideoChatFrameQualityPreset来更改视频质量,
NSMutableDictionary *videoChatConfiguration = [[QBSettings videoChatConfiguration] mutableCopy];
[videoChatConfiguration setObject:@20 forKey:kQBVideoChatCallTimeout];
[videoChatConfiguration setObject:@10 forKey:kQBVideoChatVideoFramesPerSecond];
// config video quality here
[videoChatConfiguration setObject:AVCaptureSessionPresetMedium forKey:kQBVideoChatFrameQualityPreset];
[QBSettings setVideoChatConfiguration:videoChatConfiguration];
可用选项:
//achieve high quality video and audio output.defaultvalue.
AVF_EXPORT NSString *const AVCaptureSessionPresetHigh NS_AVAILABLE(10_7, 4_0);
//achieve output video and audio bitrates suitable for sharing over WiFi.
AVF_EXPORT NSString *const AVCaptureSessionPresetMedium NS_AVAILABLE(10_7, 4_0);
//achieve output video and audio bitrates suitable for sharing over 3G.
AVF_EXPORT NSString *const AVCaptureSessionPresetLow NS_AVAILABLE(10_7, 4_0);