Setting Desktop / screenshare framerate to a small framerate

#1

I am trying to force the published frame rate to be small for bandwidth reasons.

I have tried config.videoFramerate = [5, 10]

But no matter what I do on chrome it is always publishing at 30 fps. Is there a best way to do this?

This is my stream config:

Erizo.Stream ({
screen: true,
data: false,
audio: false,
video: false,
videoSize: [1280, 960, 2560, 2048],
videoFrameRate: [3, 10],
attributes: {
name: “screenShare”,
source: shareName,
room: room,
},
extensionId: EXTENSION_ID
})

#2

Using Deadsimple.com demo for screensharing and then looking at the chrome://webrtc-internals, their desktop runs 5 frames per second, and their video contraints are:

{width: {max: 1920}, height: {max: 1080}, deviceId: {exact: [“IVcnEL0mtvbw3zlO+Et+yA==”]}, mediaStreamSource: {exact: [“desktop”]}, advanced: [{frameRate: {max: 5}}, {frameRate: {min: 5}}]}

How do I set that using Erizo?

#3

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