简体   繁体   English

如何将传入的 WebRTC 音频流混合到服务器上的单个 stream 中?

[英]How can I mix incoming WebRTC audio streams into a single stream on a server?

I'm working on a project which involves building an audio-conferencing app for the web.我正在开展一个项目,该项目涉及为 web 构建音频会议应用程序。 Currently my working system uses a WebSocket server to negotiate connections between peers, which can then stream audio directly to one another.目前我的工作系统使用 WebSocket 服务器来协商对等方之间的连接,然后可以将 stream 音频直接相互连接。 However, I wish to implement the server as its own client/peer, which will receive all incoming audio streams, "mix" them into a single source/stream, and then stream it to all peers individually.但是,我希望将服务器实现为它自己的客户端/对等点,它将接收所有传入的音频流,将它们“混合”成单个源/流,然后将 stream 单独发送给所有对等点。 The goal is to avoid direct peer-to-peer connections between user connections.目标是避免用户连接之间的直接对等连接。

Perhaps a more simple question would be how I can accomplish the concept of the given figure, the green squares being RTCPeerConnections, and the server "forwarding" the incoming streams to the recipient?也许一个更简单的问题是我如何完成给定图形的概念,绿色方块是 RTCPeerConnections,服务器将传入的流“转发”给接收者? Figure数字

How can I accomplish this, and is the concept feasible in regards to system resources of the server?我怎样才能做到这一点,关于服务器的系统资源,这个概念是否可行?

Thanks.谢谢。

You can use kurento .您可以使用kurento Its based on webRTC and its Media Server features include group communications, transcoding, recording, mixing, broadcasting and routing of audiovisual flows.它基于 webRTC 及其媒体服务器功能,包括群组通信、转码、录制、混合、广播和视听流路由。

The concept you are looking for is called Multi Conferencing Unit (MCU).您正在寻找的概念称为多会议单元(MCU)。 MCU is not part of standard WebRTC. MCU 不是标准 WebRTC 的一部分。 WebRTC is peer-to-peer only. WebRTC 仅是点对点的。

There are several media server solution that offer the MCU functionality.有几种提供 MCU 功能的媒体服务器解决方案。 kurento, as suggested by Milad, is one options. Milad 建议的 kurento 是一种选择。 Others examples are Jitsi Videobridge or Janus .其他示例是Jitsi VideobridgeJanus

A more recent approach you might want to consider is SFU (Selective Forwarding Unit).您可能要考虑的一种较新的方法是 SFU(选择性转发单元)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM