# Setting Desktop / screenshare framerate to a small framerate

**URL:** <https://discourse.lynckia.com/t/setting-desktop-screenshare-framerate-to-a-small-framerate/920>\
**Category:** Support\
**Created:** [May 1, 2019, 6:48pm UTC](https://discourse.lynckia.com/t/setting-desktop-screenshare-framerate-to-a-small-framerate/920 "2019-05-01T18:48:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marlin\_Cobb](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Marlin\_Cobb](https://discourse.lynckia.com/u/Marlin_Cobb)\
**Post date:** [May 1, 2019, 6:48pm UTC](https://discourse.lynckia.com/t/setting-desktop-screenshare-framerate-to-a-small-framerate/920/1 "2019-05-01T18:48:10Z")

</div>

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  
})

---

<div class="post-metadata">

**Author:** ![Marlin\_Cobb](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Marlin\_Cobb](https://discourse.lynckia.com/u/Marlin_Cobb)\
**Post date:** [May 2, 2019, 3:42pm UTC](https://discourse.lynckia.com/t/setting-desktop-screenshare-framerate-to-a-small-framerate/920/2 "2019-05-02T15:42:18Z")

</div>

Using [Deadsimple.com](http://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?

---

<div class="post-metadata">

**Author:** ![Marlin\_Cobb](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Marlin\_Cobb](https://discourse.lynckia.com/u/Marlin_Cobb)\
**Post date:** [May 3, 2019, 4:11pm UTC](https://discourse.lynckia.com/t/setting-desktop-screenshare-framerate-to-a-small-framerate/920/3 "2019-05-03T16:11:28Z")

</div>

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.

 ![2019-05-03_12-10-17](https://canada1.discourse-cdn.com/flex031/uploads/lynckia/original/1X/61e12830a1da839fae73fb186e56fafd5ef3b1ad.jpeg)

Does this seem legit?  
Is there something I can do to help the server be more stable?

Thank you
