Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).

createroom error

david_c_1
Beginner
544 Views

Hi,

I get the following error when I call N.API.createRoom (I use Node 6.9.5)

/opt/intelcs/webrtc/Release-v3.4/extras/basic_example/nuve.js:8 

TypeError: a.forEach is not a function
   at c (/opt/intelcs/webrtc/Release-v3.4/extras/basic_example/nuve.js:8:10901)
   at Object.e [as createRoom] (/opt/intelcs/webrtc/Release-v3.4/extras/basic_example/nuve.js:8:11273)


....

 

the api I call is:

N.API.createRoom(roomName, 
{
 mode: 'hybrid',
 publishLimit: -1,
 userLimit: 200,
 viewports: {
   "common": {
 mediaMixing: {
   video: {
     maxInput: 30,
     resolution: 'hd720p',
     multistreaming: 1,
     bitrate: 300,
     bkColor: {"r":0, "g":0, "b":0},
     layout: {
     custom: '[{"region":[{"id": "1", "left": 0,"top": 0,"relativesize": 1}]},{"region": [{"id": "1","left": 0,"top": 0.25,"relativesize": 0.49 }, {"id": "2", "left": 0.51, "top": 0.25,"relativesize": 0.49 }]}]'
     },
     avCoordinated: 0,
     crop: 1
   },
   audio: null
 },
 sipInfo:{
    sipServer:'127.0.0.1',
    username:'phone',
    password:'xxx'
 }
   }
   
}
}, 
function (roomID) {
myRoom = roomID._id;
console.log('Created room ', myRoom);
 
var type = 'socketio';
var preference = {isp: 'isp', region: 'region'};
 
N.API.createToken(myRoom, username, role, type, preference,  function (token) {
console.log(token);
res.send( JSON.stringify({token: token , roomId: myRoom}) );
return;
 
}, function() {
 
// errore createToken
res.send(getExceptionJ("Errore durante la creazione del Token di accesso.", err));
return;
 
});  // end gestione createToken
 
}, 
function() {
 
// errore createRoom
res.send(getExceptionJ("Errore durante la creazione della Room.", err));
return;
 
}
);

 

0 Kudos
11 Replies
Qiujiao_W_Intel
Employee
544 Views

Hi, there are 2 issues in the createRoom data:

1. as document https://software.intel.com/sites/products/documentation/webrtc/js/class_n_1_1_a_p_i.html#a54e2842c746d3a992891635a571cf511 defined: viewport values should be an array not an object

2. common  should be the value, its key should be name, viewports should work if defined like this: 

viewports:[{name:"common", mediaMixing: {}}]

 

0 Kudos
david_c_1
Beginner
544 Views

Thanks for the reply. 

I think you have to correct the example in the documentation on the page you mentioned. My code was taken up exactly from this example:

N.API.createRoom('myRoom', {
mode: 'hybrid',
publishLimit: -1,
userLimit: 30,
viewports: {
"common": {
mediaMixing: {
video: {
maxInput: 15,
resolution: 'hd720p',
multistreaming: 1,
bitrate: 0,
bkColor: {"r":1, "g":2, "b":255},
layout: {
base: 'lecture',
},
avCoordinated: 1,
crop: 1
},
audio: null
},
},
"another": {
mediaMixing: {
video: {
maxInput: 15,
resolution: 'hd1080p',
multistreaming: 1,
bitrate: 0,
bkColor: {"r":1, "g":2, "b":255},
layout: {
base: 'lecture',
},
avCoordinated: 1,
crop: 1
},
audio: null
},
}
}
}, function (res) {
console.log ('Room', res.name, 'created with id:', res._id);
}, function (err) {
console.log ('Error:', err);
});

 

 

0 Kudos
Qiujiao_W_Intel
Employee
544 Views

Thanks for the correction, we will update doc in the future release

0 Kudos
david_c_1
Beginner
544 Views

Hi,

I'm trying to create a room with the options below. However the room is created with the default options and no viewport is created.

In the logs I do not seem to see any  error.

What am I doing wrong?

 

opts = { 
        mode: 'hybrid',
        publishLimit: -1,
        userLimit: 200,
        enableMixing : 1,
        viewports: [
        {
                   name : "common",
                   mediaMixing: {
                  video: {
                            maxInput: 30,
                            resolution: 'hd1080p',
                            multistreaming: 1,
                            bitrate: 300,
                            bkColor: {"r":0, "g":0, "b":0},
                            layout: {
                                    custom: [{"region":[{"id": "1", "left": 0,"top": 0,"relativesize": 1}]},{"region": [{"id": "1","left": 0,"top": 0.25,"relativesize": 0.49                                                     }, {"id": "2", "left": 0.51, "top": 0.25,"relativesize": 0.49 }]}]
                            },
                      avCoordinated: 0,
                      crop: 1
              },
                      audio: null
            }
        },                 
         {
              name : "regia",
                      mediaMixing: {
                                      video: {
                                                maxInput: 30,
                                                resolution: 'hd1080p',
                                                multistreaming: 1,
                                        bitrate: 300,
                                              bkColor: {"r":0, "g":0, "b":0},
                                                layout: {
                                                custom: [{"region":[{"id": "1", "left": 0,"top": 0,"relativesize": 1}]},{"region": [{"id": "1","left": 0,"top":                                                                                         0.25,"relativesize": 0.49 }, {"id": "2", "left": 0.51, "top": 0.25,"relativesize": 0.49 }]}]
                                                },
                                                avCoordinated: 0,
                                        crop: 1
                                        },
                                audio: null
                    }
               }
           ]
};
0 Kudos
david_c_1
Beginner
544 Views

Hi,

no indication on my last question?

0 Kudos
Qiujiao_W_Intel
Employee
544 Views

Hi, David, there is a bug in v3.4 for viewport, and we have fixed it in v3.4.1. Please use MCU with 3.4.1

0 Kudos
david_c_1
Beginner
544 Views

updating to version 3.4.1 has resolved the problem, but the mixed stream bitrate does not meet the maximum set limit of 300 Kbs. It is around 2 Mbps. Why?

0 Kudos
Qiujiao_W_Intel
Employee
544 Views

Hi, david, bitrate option in createRoom API is deprecated in 3.4, if you want to limit bitrate of subscribed stream, please specify qualituLevel option in subscribe API.

0 Kudos
Qiujiao_W_Intel
Employee
544 Views

one mistake in previous comment, should be qualityLevel:

Hi, david, bitrate option in createRoom API is deprecated in 3.4, if you want to limit bitrate of subscribed stream, please specify qualityLevel option in subscribe API.

0 Kudos
david_c_1
Beginner
544 Views

Ok thanks for the reply but I would like to understand in more detail the effect of these parameters on a video session of "n" participants with heterogeneous network bandwidth. 

I'm developing a web conference application that aims to have 100 participants, so I have to be sure of the network bandwidth that I have to allocate on the server.

 

many thanks for the kind reply you will give me

 

David

 

 

 

0 Kudos
Qiujiao_W_Intel
Employee
544 Views

For subscribe actions, bandwidth mainly related to resolution and qualityLevel, here is a reference table for bitrate in different resolution and qualityLevel:

bitrate.png

0 Kudos
Reply