steep-balloon-41261
12/20/2023, 9:35 AMdry-elephant-14928
12/21/2023, 7:38 AMpurple-magazine-67414
12/21/2023, 4:46 PMtypescript room!.options.publishDefaults!.screenShareSimulcastLayers = [
new VideoPreset(1920, 1080, 700000, 3, 'low'),
new VideoPreset(1920, 1080, 1500000, 15, 'medium'),
new VideoPreset(1920, 1080, 3000000, 30, 'high'),
];
Although we use simulcast we also tried with the high layer only (no simulcast) with same results. We also verified that presets using the CLI to get current layers for screenshare track:
{
"sid": "TR_VScMuGhAYxgPeu",
"type": 1,
"width": 1920,
"height": 1080,
"simulcast": true,
"source": 3,
"layers": [
{
"width": 1920,
"height": 1080,
"bitrate": 700000,
"ssrc": 651341139
},
{
"quality": 1,
"width": 1920,
"height": 1080,
"bitrate": 1500000,
"ssrc": 1738773883
},
{
"quality": 2,
"width": 1920,
"height": 1080,
"bitrate": 3000000,
"ssrc": 3819408581
}
],
"mime_type": "video/H264",
"mid": "4",
"codecs": [
{
"mime_type": "video/H264",
"mid": "4",
"cid": "f27f1c67-a19d-45c5-b753-c0613ae36fc0",
"layers": [
{
"width": 1920,
"height": 1080,
"bitrate": 700000,
"ssrc": 651341139
},
{
"quality": 1,
"width": 1920,
"height": 1080,
"bitrate": 1500000,
"ssrc": 1738773883
},
{
"quality": 2,
"width": 1920,
"height": 1080,
"bitrate": 3000000,
"ssrc": 3819408581
}
]
}
]
And when se see webrtc stats on chrome for the high layer shows that bandwidth is not limiting, it even hardly gets to the limit set on the preset, but framerate gets real low, the point is that the framerate achieved seems to depend on the content in the screen share, If screensharing a video with low detail like this framerate can get to an acceptable 15-20 fps (although not sustained). However with a highly detailed video like this one framerate drops even below 2-4 fps. Stats in webrtc-internals are as follows in the attached imagepurple-magazine-67414
12/21/2023, 4:50 PMpurple-magazine-67414
12/21/2023, 4:51 PMdry-elephant-14928
12/21/2023, 5:14 PMRoomOptions ? There's also a field for configuring the capturer.. and I suspect the FPS there is incorrectpurple-magazine-67414
12/21/2023, 5:19 PMpurple-magazine-67414
12/21/2023, 5:30 PM{
"adaptiveStream": false,
"dynacast": false,
"stopLocalTrackOnUnpublish": true,
"reconnectPolicy": {
"_retryDelays": [
0,
300,
1200,
2700,
4800,
7000,
7000,
7000,
7000,
7000
]
},
"disconnectOnPageLeave": true,
"expWebAudioMix": false,
"audioCaptureDefaults": {
"autoGainControl": true,
"echoCancellation": true,
"noiseSuppression": true
},
"videoCaptureDefaults": {
"resolution": {
"width": 1280,
"height": 720,
"frameRate": 30,
"aspectRatio": 1.7777777777777777
},
"deviceId": "7f3bab027ea9b85d3e1d00a3579df0288c6fd2394fa250a73b94ce568b1efa16"
},
"publishDefaults": {
"audioBitrate": 32000,
"audioPreset": {
"maxBitrate": 32000
},
"dtx": true,
"red": true,
"forceStereo": false,
"simulcast": true,
"screenShareEncoding": {
"maxBitrate": 3000000,
"maxFramerate": 30,
"priority": "high"
},
"stopMicTrackOnMute": false,
"videoCodec": "h264",
"backupCodec": false,
"screenShareSimulcastLayers": [
{
"width": 1920,
"height": 1080,
"encoding": {
"maxBitrate": 700000,
"maxFramerate": 3,
"priority": "low"
}
},
{
"width": 1920,
"height": 1080,
"encoding": {
"maxBitrate": 1500000,
"maxFramerate": 15,
"priority": "medium"
}
},
{
"width": 1920,
"height": 1080,
"encoding": {
"maxBitrate": 3000000,
"maxFramerate": 30,
"priority": "high"
}
}
],
"videoEncoding": {
"maxBitrate": 3000000,
"maxFramerate": 30,
"priority": "high"
}
}
}dry-elephant-14928
12/21/2023, 7:15 PMpurple-magazine-67414
12/21/2023, 7:45 PMdry-elephant-14928
12/22/2023, 2:24 AMlocalParticipant.setScreenShareEnabled(true, {
resolution: {
width: 1920,
height: 1080,
frameRate: 30,
},
}
also, in your screenShareSimulcastLayers settings, you should be specifying only the additional layers you'd like to publish. The captured stream will be published as is.purple-magazine-67414
12/22/2023, 8:05 AMpurple-magazine-67414
12/22/2023, 12:52 PMdry-elephant-14928
12/22/2023, 5:16 PMdry-elephant-14928
12/22/2023, 5:16 PMpurple-magazine-67414
12/22/2023, 5:18 PMdry-elephant-14928
12/22/2023, 5:26 PMdry-elephant-14928
12/22/2023, 5:26 PMpurple-magazine-67414
12/23/2023, 4:17 PM