I am trying to send large screen shares 1920x1080. They can be very slow 1 to 5 frames per second, the slide show option (1 ever 2 s) is too slow. I have about 150 viewers.
I walked through erizo client side code to see how the constraints are passed and it is a historic maze as you can imagine as specs change etc.
The Erizo.Stream did not work for limiting the screenshare to 5 frames per second as the constraints were not passed to the getUserMedia call.
I decided to see if I could make that call myself (I can) and then pass the stream into the Erizo stream object.
This is what I did using the new getDisplayMedia call:
var stream = Erizo.Stream ({
screen: true,
data: false,
audio: false,
video: true,
attributes: {
name: "screenShare",
source: shareName,
room: room,
},
extensionId: EXTENSION_ID
})
var videoConstraints = {
"aspectRatio": 1.7777777777777777,
"deviceId": "screen:0:0",
"frameRate": 5,
"height": 1080,
"resizeMode": "crop-and-scale",
"width": 1920,
"cursor": "always",
"displaySurface": "monitor",
"logicalSurface": true,
}
stream.stream = await navigator.mediaDevices.getDisplayMedia(videoConstraints);
var id = await room.publish(shareStreams[cN], { maxVideoBW:1000, minVideoBW: 0,
simulcast: {numSpatialLayers: 3} })
stream.stream.onended = function () {
L.info('shareStream', cN, ' stopped by user');
shareStreams[cN].close();
$("#screen_share").removeClass("on").addClass("off");
};
That seems to work ok, but the server side is a bit wonky, every time someone subscribes the frame rate drops in a spike from the publishing side and then occasionally becomes us stable.
Does this seem legit?
Is there something I can do to help the server be more stable?
Thank you