Mixing streams concept in kurento media server

2019-05-26 03:05发布

问题:

Can anybody explain what is the basic concept in mixing in Kurento media server? As it is mentioned in what kurento provides, there is a term mixing. So, I would like to know what kurento Media server mixes. As,

  1. Do it mix multi stream generated by a user into one stream and broadcast that stream to other receiving user? If it does this how to use this concept

  2. Do kurento able to receive multi-streams through one PeerConnection object with user, i.e., at one WebRtcEndPoint Kurento can receive or send multi stream by mixing those streams into one stream?


Edit Regarding Answer Update

So, I can use mixing concept by using Hubport.

Now, do this HubPort supports different MediaTypes. As, if one user is streaming its screen sharing and at the same time he is streaming its audio also. So, do this composite element mix both the streams to one and stream one single stream to all other users?

回答1:

The concept of mixing refers to combining several media streams into one. This can be better understood with a conference room. In other setups, every user would have one stream going out, and another coming in for each other participant (except himself). That leaves you with 1 + (n -1) = n streams per participant. This results in n * n streams total, where n is the number of participants.

Mixing all streams in the media server allows you to save bandwidth, ideal in scenarios like mobile devices connected through 3G, for instance. What the mixer does, it combines all the streams into one, so each user is sending one stream, and receiving one stream that has all the combined participant's media (except his own). So just two streams per user saves a lot of bandwidth.

This, however, has a toll on CPU consumption, as it's necessary to adapt the videos to the new resolution, combine them... there is some processing involved.

On the other hand, the concept you are referring to is multicast, which is the ability to send several streams through one WebRTC connection. This doesn't save bandwidth, nor combines all the streams into one, but helps you reduce the number of endpoints present in your deployment. this is in our roadmap, but can't tell you when that'll be.


EDIT

Mixing can be achieved in the media server through the Composite media element. You can check this other SO answer for more info on how to use that media element.