我想在使用ios AppRTCDemo的iPhone 4s和使用android AppRTCDemo的nexus4之间进行流畅的视频通话。我想为视频提供一定的质量,基本上越高越好,但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),当设置较低的分辨率时效果很好,但较低分辨率的质量对我来说太低了。
(我还测试了两个android设备,通话似乎工作正常(分辨率设置为640x480 )。
如何才能让iphone和android设备之间的通话以640x480的分辨率流畅运行?
还有没有其他的限制条件可以让它正常工作?
我在某处读到过关于leakybucket约束的内容,但它没有帮助。(而且,我不能完全确定是否将约束放在了正确的位置)
谢谢
更新:
经过更多的测试,将maxFrameRate约束减少到15有助于“以较小的延迟显示来自本地摄像头本身的馈送”。有了新的限制,几乎没有延迟,看起来视频质量几乎保持不变,但分辨率仍然设置为320x240
发布于 2014-08-13 20:15:00
经过大量的测试和在discuss-webrtc上经历了很多线程后,我意识到iPhone 4s不够“强大”,不足以运行640x480分辨率的平滑调用,似乎会产生较高的cpu,然后降低分辨率。它甚至在352 x 288分辨率下挣扎...
https://stackoverflow.com/questions/25136887
复制相似问题