使用iOS AppRTCDemo拨打电话,分辨率设置为480x640

时间:2014-08-05 10:44:02

标签: ios webrtc

我希望在带有ios AppRTCDemo的iPhone 4s和带有Android AppRTCDemo的nexus 4之间进行流畅的视频通话。 我希望视频具有一定的质量,基本上越高越好,但480x640目前可以满足我的需求。

我在每个设备上运行AppRTCDemo(来自r6783)(每个设备都有apprtcDemo用于其平台)。

我为本地视频设置了约束:

RTCPair *localVideoMaxWidth = [[RTCPair alloc] initWithKey:@"maxWidth" value:@"640"];

RTCPair *localVideoMinWidth = [[RTCPair alloc] initWithKey:@"minWidth" value:@"640"];

RTCPair *localVideoMaxHeight = [[RTCPair alloc] initWithKey:@"maxHeight" value:@"480"];

RTCPair *localVideoMinHeight = [[RTCPair alloc] initWithKey:@"minHeight" value:@"480"];

RTCPair *localVideoMaxFrameRate = [[RTCPair alloc] initWithKey:@"maxFrameRate" value:@"30"];

RTCPair *localVideoMinFrameRate = [[RTCPair alloc] initWithKey:@"minFrameRate" value:@"5"];

RTCPair *localVideoGoogLeakyBucket = [[RTCPair alloc] initWithKey:@"googLeakyBucket" value:@"true"];

RTCMediaConstraints *videoSourceConstraints = [[RTCMediaConstraints alloc] initWithMandatoryConstraints:@[localVideoMaxHeight, localVideoMaxWidth, localVideoMinHeight, localVideoMinWidth, localVideoMinFrameRate, localVideoMaxFrameRate, localVideoGoogLeakyBucket] optionalConstraints:@[]];

RTCMediaStream *localMediaStream = [self.peerConnectionFactory mediaStreamWithLabel:@"ARDAMS"];

NSString *cameraID = @"Back Camera";

NSAssert(cameraID, @"Unable to get the back camera id");

RTCVideoCapturer *capturer = [RTCVideoCapturer capturerWithDeviceName:cameraID];

self.videoSource = [self.peerConnectionFactory videoSourceWithCapturer:capturer constraints:videoSourceConstraints];

在Android AppRTCDemo中为本地视频源设置相同的约束。

这里发生了什么:

开始通话,然后我获得本地视频

在其他对等方加入通话之前,视频看起来很流畅(来自本地相机)。

在其他对等连接之后立即:

当呼叫开始时(两个同伴都在通话中)我得到了很多这样的信息:

Estimated available bandwidth 29 kbps is below configured min bitrate 30 kbps.

然后:

Warning(webrtcvideoengine.cc:1469): webrtc: (send_side_bandwidth_estimation.cc:206): Estimated available bandwidth 29 kbps is below configured min bitrate 30 kbps.

Warning(webrtcvideoengine.cc:1469): webrtc: (send_side_bandwidth_estimation.cc:206): Estimated available bandwidth 29 kbps is below configured min bitrate 30 kbps.

Warning(webrtcvideoengine.cc:1469): webrtc: (send_side_bandwidth_estimation.cc:206): Estimated available bandwidth 29 kbps is below configured min bitrate 30 kbps.

VAdapt Frame: scaled 240 / out 1620 / in 1620 Changes: 2 Input: 480x640 i33333333 Scale: 0.5 Output: 240x320 i33333333 Changed: false

VAdapt CPU Request: keep Steps: 2 Changed: false To: 240x320

VAdapt CPU Request: down Steps: 2 Changed: false To: 240x320

VAdapt Frame: scaled 330 / out 1710 / in 1710 Changes: 2 Input: 480x640 i33333333 Scale: 0.5 Output: 240x320 i33333333 Changed: false

VAdapt CPU Request: keep Steps: 2 Changed: false To: 240x320

VAdapt Frame: scaled 420 / out 1800 / in 1800 Changes: 2 Input: 480x640 i33333333 Scale: 0.5 Output: 240x320 i33333333 Changed: false

VAdapt CPU Request: down Steps: 2 Changed: false To: 240x320

当我收到消息时:VAdapt CPU Request: keep Steps: 2 Changed: false To: 240x320

然后这条消息:" Estimated available bandwidth 29 kbps is below configured min bitrate 30 kbps"停止并将分辨率设置为较低(我猜这是预期的行为)但我希望将分辨率保持在640x480。

之后,视频输入有延迟,但奇怪的是,似乎延迟来自本地摄像机视图,来自本地摄像机本身的馈送以小延迟显示,因此视频传输时延迟到其他同行和较低分辨率。

我尝试使用较低分辨率(320x240),设置较低分辨率时效果很好,但分辨率较低的质量对我来说很低。

(我还测试了2个Android设备,并且呼叫似乎工作正常(分辨率设置为640x480。

如何在iphone和Android设备之间以640x480的分辨率顺畅地运行呼叫?

我可以设置任何其他限制以使其正常工作吗?

我在某处读到了有关漏桶的约束,但它并没有帮助。 (另外,我并不完全确定我将约束放在正确的位置)

由于

更新:

经过更多测试后,将maxFrameRate约束减少到15有助于"来自本地摄像机本身的馈送以小延迟显示"。使用新约束几乎没有延迟,似乎视频质量几乎保持不变,但分辨率仍然设置为320x240

1 个答案:

答案 0 :(得分:3)

经过大量的测试并经历了discuss-webrtc上的很多主题后,我意识到iPhone 4s并不是很强大的。足以运行640x480分辨率的平滑调用,似乎生成高CPU然后降低分辨率。它以352x288的分辨率平衡了......