7

I am able to stream video with Kurento using WebRTC, I need to implement multi party audio conference using MCU feature of Kurento Media server. So audio coming from all clients are merged and send back that combined audio to all clients in efficient manner using WebRTC.

if it will works then we need only two connection(one for send and one for receive) other wise we need peer connection to all clients using WebRTC. It is not feasible to establish peer connection to all all clients.

Please suggest me any sample code which have implemented MCU for audio using Kurento Media Server or guide me to implement same using Kurento Media Server.

Nilesh Wagh
  • 940
  • 1
  • 12
  • 26

1 Answers1

4

I'm afraid there's no code that allows that un Kurento. There is the Composite media element, but that is usually for audio AND video. It combines streams into a single stream matrix of the required size, usually more than 9 streams may have performance problems. If you only want to process audio, surely it could handle much more than 9 streams. To use only audio just connect AUDIO stream to the HubPort.


EDIT 1

The code to generate the media elements needed, and the correct way establish an audio-only connection is as follows.

WebRtcEndpoint webrtc = new WebRtcEndpoint.Builder(pipeline).build();
Composite composite = new Composite.Builder(pipeline).build();
HubPort hubport = new HubPort.Builder(composite).build();
webrtc.connect(hubport, MediaType.AUDIO);

Please note that the connection is from the WebRtcEndpoint to the HubPort. If you need it to be bidirectional, you'll need to connect that way also.

hubport.connect(webrtc, MediaType.AUDIO);
igracia
  • 3,543
  • 1
  • 18
  • 23
  • Is it possible to use Composite media element by sending only audio stream(I will try to remove video part from SDP which send to server)? Or is there need any changes in [composite](https://github.com/Kurento/kms-elements/blob/3c6d673ddadfcce0ab23a7856b356a7de0069cf0/src/gst-plugins/kmscompositemixer.c) media element code? – Nilesh Wagh Apr 04 '16 at 06:39
  • @NileshWagh No need to remove anything (unless you want to save that bandwidth, which makes a lot of sense). Just remember to invoke connect with the media type. I'm editing the answer to include the full command as it should be. – igracia Apr 04 '16 at 07:16
  • 1
    You have any reference for JavaScript(node) implementation for such audio conference using composite media element. Please suggest me to some sample code. – Nilesh Wagh Apr 05 '16 at 13:47
  • @NileshWagh Have you get any sort of sample code regarding composite element? – Akshay Rathore May 02 '16 at 12:45
  • 1
    @akshay You can refer [this](https://github.com/Nileshwagh22/kurento-composite-media-element-for-audio) for audio composer. – Nilesh Wagh May 03 '16 at 02:28
  • @NileshWagh I had referred to the link you provided to me and used composite element to stream audio in group of 5 users, but the CPU usage goes too high. Have you also met with this CPU toll problem? If it is working smoothly in your case could you tell me your's server configuration, as right now I am using AWS m3-medium machine. – Akshay Rathore May 11 '16 at 12:39
  • @AkshayRathore were you able to make it work with more users eventually? I have a similar usage pattern but looking to scale to hundreds of users. – Billy May 20 '20 at 01:55