问题描述
来自Mozilla网站:
From Mozilla site: https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API
MediaStream由零个或多个MediaStreamTrack对象组成,代表各种音频或视频轨道。 MediaStreamTrack可以有一个或多个频道。频道代表媒体流的最小单位,例如与给定扬声器相关的音频信号,如立体声音轨中的左或右。
"A MediaStream consists of zero or more MediaStreamTrack objects, representing various audio or video tracks. Each MediaStreamTrack may have one or more channels. The channel represents the smallest unit of a media stream, such as an audio signal associated with a given speaker, like left or right in a stereo audio track."
这说明了一个渠道是什么。
That clarifies what a channel is.
最近几个RFC(例如8108)指的是需要有在一个RTP会话中发送的多个流。每个流都有自己的RTP级别的SSRC。
在统一规划的RFC中,引用始终是作为最低级别(不是轨道或通道)的流。在RFC 3550中,基本RTP RFC,没有对通道的引用。
Several recent RFCs (E.g. 8108) refer to the need to have multiple streams sent in one RTP session. Each stream is to have its own SSRC at the RTP level.In the RFC for Unified Plan too, the reference is always to a stream as the lowest level (not tracks or channels). In RFC 3550, the base RTP RFC, there is no reference to channel.
这些RFC中引用的RTP流是否表示流是最低的媒体源,与WebRTC中使用的通道相同,以及以上引用?
轨道(WebRTC)的频道和带有SSRC的RTP流之间是否存在一对一的映射?
Is the RTP stream as referred in these RFCs, which suggest the stream as the lowest source of media, the same as channels as that term is used in WebRTC, and as referenced above?Is there a one-to-one mapping between channels of a track (WebRTC) and RTP stream with a SSRC?
例如,网络摄像头生成媒体流可以具有音频媒体轨道和视频媒体轨道,每个轨道使用单独的SSRC在RTP分组中传输,产生两个SSRC。那是对的吗?现在如果有一个立体声网络摄像头(或一些这样的设备,让我们说两个麦克风 - 通道?)。这会产生三个具有三个不同的独特SSRC的RTP流吗?
A webcam, for example, generates a media stream, which can have a audio media track and a video media track, each track is transported in RTP packets using a separate SSRC, resulting in two SSRCs. Is that correct? Now what if there is a stereo webcam (or some such device with, lets say two microphones - channels?). Will this generate three RTP streams with three different unique SSRCs?
在成功测试ICE候选人后,是否有一个用于五元组连接的RTP会话?或者可以在同一组之间的同一组port-ip-UDP连接上有多个RTP会话?
Is there a single RTP session for a five-tuple connection established after successful test of ICE candidates? Or can there be multiple RTP sessions over the same set of port-ip-UDP connection between peers?
任何澄清这一点的文件都将受到赞赏。
Any document that clarifies this would be appreciated.
推荐答案
不完全。只有 音频 曲目才有频道。除非您使用至,但这些不同,与媒体流和曲目无关。
*) There's also data channels, but those are different, and have no relation to media streams and tracks.
不。粗略地说,你可以说:
No. Roughly speaking, you can say:
但这不是整个故事,因为。简而言之,您可以在实时通话期间随时替换正在使用其他曲目发送的曲目,而无需重新协商您的连接。重要的是,另一方的 receiver.track
在这种情况下不会改变,只有它的输出。这将管道与通过它的内容分开。
But that's not the entire story, because of sender.replaceTrack(withTrack)
. In short, you can replace a track that's being sent with a different track anytime during a live call, without needing to renegotiate your connection. Importantly, the other side's receiver.track
does not change in this case, only its output does. This separates the pipe from the content that goes through it.
因此在发送方面,更公平地说:
So on the sending side, it's more fair to say:
.. 。在接收方,它更简单,并且总是这样说:
...whereas on the receiving side, it's simpler, and always true to say:
有道理吗?
在, MediaStream
s是哑容器 - 您可以使用 stream.addTrack(track)
和 stream.removeTrack(track)
- 此外, RTCPeerConnection
仅处理 曲目 。例如:
In modern WebRTC, MediaStream
s are dumb containers—You may add or remove tracks from them as you please using stream.addTrack(track)
and stream.removeTrack(track)
—Also, RTCPeerConnection
deals solely with tracks. E.g.:
for (const track of stream.getTracks()) {
pc.addTrack(track, stream);
}
之间a MediaStreamTrack
和SSRC,是。
Between a MediaStreamTrack
and SSRC, yes.
在这种情况下是的,因为音频永远不能与视频捆绑,反之亦然。
Yes in this case, because audio can never be bundled with video or vice versa.
没有区别。立体声音轨仍然是单个音轨(和单个RTP流)。
No difference. A stereo audio track is still a single audio track (and a single RTP stream).
不同时。但是多个轨道可以共享同一个会话,除非你使用非默认值:
Not at the same time. But multiple tracks can share the same session, unless you use the non-default:
new RTCPeerConnection({bundlePolicy: 'max-compat'});
如果不这样做,或使用,然后同类轨道可以捆绑到单个RTP中会话。
If you don't, or use any other mode, then same-kind tracks may be bundled into a single RTP session.
这篇关于WebRTC:频道,曲目和电视之间的关系;与RTP SSRC和RTP会话相关的流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!