use*_*726 8 javascript streaming voip webrtc opus
我已经用最高质量的设置和多个 STUN/TURN 服务器进行了测试,但没有找到真正高质量的流。
根据我的经验,webRTC 总是具有波动且有限的带宽和高水平的背景噪音,无法达到 mp3/Shoutcast/Icecast 无线电流的质量。
有没有人找到一种通过 webRTC 提供真正高带宽音频流的方法,或者目前实际上不可能?
Kim*_*m T 15
The default audio settings for WebRTC are pretty low. It defaults to mono audio around 42 kb/s as it seems to be designed for voice. I increased the quality by configuring a few settings.
autoGainControl, echoCancellation and noiseSuppression in the getUserMedia() constraints:navigator.mediaDevices.getUserMedia({
audio: {
autoGainControl: false,
channelCount: 2,
echoCancellation: false,
latency: 0,
noiseSuppression: false,
sampleRate: 48000,
sampleSize: 16,
volume: 1.0
}
});
Run Code Online (Sandbox Code Playgroud)
stereo and maxaveragebitrate attributes to the SDP:let answer = await peer.conn.createAnswer(offerOptions);
answer.sdp = answer.sdp.replace('useinbandfec=1', 'useinbandfec=1; stereo=1; maxaveragebitrate=510000');
await peer.conn.setLocalDescription(answer);
Run Code Online (Sandbox Code Playgroud)
This gives a potential maximum bitrate of 520kbps for stereo, which is 260kbps per channel!
Actual bitrate depends on the speed of your network and strength of your signal.
More information about the SDP:
The Session Description Protocol (SDP) [RFC4566] describes various aspects of multimedia session such as media capabilities, transport addresses and related metadata in a transport agnostic manner, for the purposes of session announcement, session invitation and parameter negotiation.
https://tools.ietf.org/id/draft-nandakumar-rtcweb-sdp-01.html#rfc.section.3
Check out my project which implements these features: https://github.com/kmturley/webrtc-radio
首先,值得一提的是,Web RTC 建立在底层网络连接之上,如果它很差,那么任何更高层都几乎无法避免这种情况。
查看您突出显示的特定比较,有几个因素是 VoIP 语音质量的关键(假设您专注于问题中的语音):
将此与流媒体广播等进行比较,关键点是延迟 - 等待几秒钟才能开始播放流并不罕见。
这允许接收器填充更大的等待解码和回放的数据包缓冲区,并使其更能容忍延迟(抖动)的变化。
举一个简单的例子,如果你的连接有半秒的短暂中断,这将立即影响双向 VoIP 呼叫,但它可能根本不会影响流音频,假设网络完全恢复并且缓冲区有几秒钟的价值当时里面的内容。
因此,与流式音频相比,您看到的质量差异很可能与通信的真实本质有关,而不是与 WebRTC 固有的故障有关 - 或者更准确地说,即使 WebRTC 是完美的,实时双向 VoIP 也很容易受到影响到网络条件。
作为。请注意,视频清晰需要更多的带宽,并且也受网络的影响,但人们往往比多媒体通话中的语音质量问题更能容忍视频“断断续续”(此时 amyay)。
| 归档时间: |
|
| 查看次数: |
6479 次 |
| 最近记录: |