MCU Kurento

307 views
Skip to first unread message

heiner...@gmail.com

unread,
Sep 30, 2020, 10:27:52 AM9/30/20
to kurento

Hello 
 They can help me to implement the MCU on my Murento server. They told me that it is with the composite but how to install it or how the composite works. Thank you.  

andres tello

unread,
Sep 30, 2020, 10:48:32 AM9/30/20
to kur...@googlegroups.com
Composite is a vide and audio mixer. 
  
You add ports to composite, and each input signal will be added to the output video, creating a GRID. 

Viewers get only the composed output: example
 
untitled-f002093.png


And I add "co hosts" as needed with this code using node.js: 

    function addCompanion(sessionId, ws, sdpOffer, clean_title, callback){
        clearCandidatesQueue(sessionId);
        if(!Theaters[clean_title].coHosts.hasOwnProperty(sessionId)){
            console.log("companion not registered");
            return callback(Theaters[clean_title].coHost);
        }
        Theaters[clean_title].pipeline.create('WebRtcEndpoint', function(error, _webRtcEndpoint) {
            if (error) {
                return callback(error);
            }
            coHost=Theaters[clean_title].coHosts[sessionId];        
            coHost.webRtcEndpoint = _webRtcEndpoint;
            if(!_webRtcEndpoint){
                sendError(ws, "No WebRTC for coHost");
                return callback("No webrtc for coHost");
            }
            console.log("companionResponse webRtcEndpoint created...");
            if (candidatesQueue[sessionId]) {
                while(candidatesQueue[sessionId].length) {
                    var candidate = candidatesQueue[sessionId].shift();
                    coHost.webRtcEndpoint.addIceCandidate(candidate);
                }
            }
            console.log("companionResponse iceCadantes offered");  

            coHost.webRtcEndpoint.on('OnIceCandidate', function(event) {
                var candidate = kurento.getComplexType('IceCandidate')(event.candidate);
                ws.send(JSON.stringify({
                    id : 'iceCandidate',
                    candidate : candidate
                }));
            });  

            coHost.webRtcEndpoint.processOffer(sdpOffer, function(error, sdpAnswer) {
                if (error) {
                    stop(sessionId, clean_title);
                    return callback(error);
                }
                Promise.all([
                    Theaters[clean_title].composite.createHubPort(function(error, _hubport){
                        coHost.hubPort=_hubport;
                    })                
                ]).then(function(){
                        coHost.webRtcEndpoint.connect(coHost.hubPort); //steram to composite
                        coHost.hubPort.connect(coHost.webRtcEndpoint); //steram from composite
                        coHost.ws=ws;
                        Theaters[clean_title].masterOfCeremony.ws.send(JSON.stringify({ id: "onLine", camera: coHost.camera, sessionId: sessionId }));
                }).catch(function(error){
                    console.log("Error adding cmpanion", error);
                });
                console.log("coHost added done...");
                callback(null, sdpAnswer);
               
            });
            coHost.webRtcEndpoint.gatherCandidates(function(error) {
                if (error) {
                    stop(sessionId, clean_title);
                    return callback(error);
                }
            });                    
        });
    }

And viewers are added like this: 
function addViewer(sessionId, ws, sdpOffer, clean_title, callback){
            clearCandidatesQueue(sessionId);
            if(Theaters[clean_title].atendees.hasOwnProperty(sessionId)){
                console.log("Antendee duplicated");
                return callback(Theaters[clean_title].atendees[sessionId]);
            }
            atendee = {
                id: sessionId,
                ws: ws,
                hubPort: false,
                webRtcEndpoint: false,
            }
            ///start Vuewer
                Theaters[clean_title].pipeline.create('WebRtcEndpoint', function(error, _webRtcEndpoint) {
                    if (error) {
                        return callback(error);
                    }
                    atendee.webRtcEndpoint = _webRtcEndpoint;
                    console.log("Atendee webRtcEndpoint created...");
                    if (candidatesQueue[sessionId]) {
                        while(candidatesQueue[sessionId].length) {
                            var candidate = candidatesQueue[sessionId].shift();
                            atendee.webRtcEndpoint.addIceCandidate(candidate);
                        }
                    }
               
                    atendee.webRtcEndpoint.on('OnIceCandidate', function(event) {
                        var candidate = kurento.getComplexType('IceCandidate')(event.candidate);
                        ws.send(JSON.stringify({
                            id : 'iceCandidate',
                            candidate : candidate
                        }));
                    });  
                   
                    atendee.webRtcEndpoint.processOffer(sdpOffer, function(error, sdpAnswer) {
                        if (error) {
                            stop(sessionId, clean_title);
                            return callback(error);
                        }

                        Theaters[clean_title].atendees[sessionId]=atendee;
                        if(Theaters[clean_title].master==1){
                            Theaters[clean_title].masterOfCeremony.webRtcEndpoint.connect(atendee.webRtcEndpoint);
                            atendee.hubPort=false;
                        }
                        if(Theaters[clean_title].master==2){
                            Theaters[clean_title].composite.createHubPort(function(error, hubPort){
                                atendee.hubPort=hubPort;
                                atendee.hubPort.connect(atendee.webRtcEndpoint);
                            });
                        }
                        console.log("Atendee["+sessionId+"] conected to "+clean_title+"to master "+Theaters[clean_title].master);
                        Theaters[clean_title].atendees[sessionId]=atendee;

                       
                        atendee.webRtcEndpoint.gatherCandidates(function(error) {
                            if (error) {
                                stop(sessionId, clean_title);
                                return callback(error);
                            }
                        });                    
                        callback(null, sdpAnswer);
                    });
                });
            //eof viewer
    }



At front end cohost/companion  use send and receive webrtcpeer and for viewers receive only... 
Main diffrence,  Image providers (co host) connect from and to the composite hub.
  coHost.webRtcEndpoint.connect(coHost.hubPort); //steram to composite
  coHost.hubPort.connect(coHost.webRtcEndpoint); //steram from composite 
mean while,  viewers only connects from composite
    atendee.hubPort.connect(atendee.webRtcEndpoint);

Hubport in both cases is created from composite, and obviously, everything is created from the same pipeline... 


On Wed, Sep 30, 2020 at 9:27 AM heiner...@gmail.com <heiner...@gmail.com> wrote:

Hello 
 They can help me to implement the MCU on my Murento server. They told me that it is with the composite but how to install it or how the composite works. Thank you.  

--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/33f632bd-d84a-4ef4-a189-83599098cc62n%40googlegroups.com.

gharia...@gmail.com

unread,
Sep 30, 2020, 10:48:41 AM9/30/20
to kurento
Please fo through this doc which explains Endpoints and Composite, Hubs etc, basically terminology in Kurento

https://doc-kurento.readthedocs.io/en/latest/features/kurento_api.html

heiner...@gmail.com

unread,
Sep 30, 2020, 11:03:36 AM9/30/20
to kurento
Thank you.

 then to be able to have access to the compound files, hub, etc. I must connect to the kurento API, is correct ?

Hemrajsinh Gharia

unread,
Sep 30, 2020, 11:28:15 AM9/30/20
to kur...@googlegroups.com
Kurento has Java and JavaScript client library that you can use it to connect to kurento. For more details refer to the examples provided.

Thanks,
Hemrajsinh Gharia



--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.

heiner...@gmail.com

unread,
Sep 30, 2020, 11:57:24 AM9/30/20
to kurento
ok I have already seen the complete documentation of the API and its elements, as well as the kurento java client, now how can I connect to the kurento java client?

Sorry I'm a bit lost and I don't understand this topic much.

I already have the kurento-group call running but I need to do it with the MCU and I have not succeeded

Thank you

heiner...@gmail.com

unread,
Sep 30, 2020, 5:58:06 PM9/30/20
to kurento
??

andres tello

unread,
Sep 30, 2020, 9:23:35 PM9/30/20
to kur...@googlegroups.com
there are several composite examples at github, search for kurento composite... 

Also, you could ask if someone wants to be hired to help you too... 
 
I do javascript stuff only... 


Russ B

unread,
May 25, 2021, 1:41:00 AM5/25/21
to kurento
Does anyone know of any working demo/example code (preferably Node.JS) for Kurento based web conferencing using MCU (not SFU) protocol???  
Reply all
Reply to author
Forward
0 new messages