gpt4 book ai didi

ios - WebRTC iOS SignalEncoderTimedOut

转载 作者:行者123 更新时间:2023-11-28 07:48:05 26 4
gpt4 key购买 nike

我尝试将视频从 iOS 设备翻译到 Chrome 浏览器。在 iOS 上,我正在执行以下操作:

let conf=RTCConfiguration()
conf.iceServers=[RTCIceServer(urlStrings: ["stun:stun.l.google.com:19302"])]
let cond=RTCMediaConstraints.init(mandatoryConstraints: ["OfferToReceiveAudio":"true","OfferToReceiveVideo":"true"], optionalConstraints: [:])
self.conn=fact?.peerConnection(with: conf, constraints: cond, delegate: self)
let mcons=RTCMediaConstraints.init(mandatoryConstraints: [:], optionalConstraints: [:])
let asrc=fact?.audioSource(with: mcons)
let atrk=self.fact!.audioTrack(with: asrc!, trackId: "aud")
atrk.isEnabled=true
conn?.add(atrk, streamIds: ["str"])

let vsrc=self.fact!.videoSource()
self.vcap=RTCCameraVideoCapturer.init(delegate: vsrc)
let vtrk=self.fact!.videoTrack(with: vsrc, trackId: "vid")
conn?.add(vtrk, streamIds: ["str"])
vtrk.isEnabled=true

conn?.offer(for: RTCMediaConstraints.init(mandatoryConstraints: ["OfferToReceiveAudio":"true","OfferToReceiveVideo":"true"], optionalConstraints: nil), completionHandler: {
(sdp,err) in do {
...
}
}
func peerConnection(_ peerConnection: RTCPeerConnection, didChange newState: RTCIceConnectionState) {
switch newState {
...
case RTCIceConnectionState.connected:
self.log(msg: "RTCIceConnectionState: connected")

DispatchQueue.main.async {
let cam=AVCaptureDevice.default(.builtInWideAngleCamera, for: AVMediaType.video, position: .back)
let formats=RTCCameraVideoCapturer.supportedFormats(for: cam!)
let form=formats[0]
self.vcap!.startCapture(with: cam!, format: form, fps: 10) {
err in
}
}
break
...
}
}

我连接成功,对方有音视频轨,但是没有视频传输。iOS devive 上的日志向我显示了以下行:

 (video_send_stream_impl.cc:580): SignalEncoderTimedOut, Encoder timed out.

如何让视频翻译工作?

我也看到音频捕获和传输,但没有听到 chrome 的声音。

GoogleWebRTC (1.1.23260)

iOS 11.3.1(iPhone SE)

Xcode 9.3.1 (9E501)

MacOS 上的 Chrome 66.0.3359.181 64 位

最佳答案

保留vsrc解决了问题

关于ios - WebRTC iOS SignalEncoderTimedOut,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50425785/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com