This message was deleted.
# helpdesk
s
This message was deleted.
d
I would think this is possible. can you share the settings that you are using?
p
Sure, we are using a customized version of your meet application where we set the following presets for screenshare:
Copy code
typescript  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:
Copy code
{
      "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

https://www.youtube.com/watch?v=sgNR-hA-Bho▾

framerate can get to an acceptable 15-20 fps (although not sustained). However with a highly detailed video like this one

https://www.youtube.com/watch?v=9YPiLU8BIp4▾

framerate drops even below 2-4 fps. Stats in webrtc-internals are as follows in the attached image
One point that we noticed is that while on this low framerate issue, we see on webrtc internals that sent framerate is about 1-3 fps, however on another meet participant on another browser we can get event see images frozen for more than 3-4 seconds (received framerate way below 1 fps). That is, it seems that we may be receiving even less framerate than the one sent from the browser.
If you can provide any insight on how to improve this situation we would be very grateful.
d
could you share the entire
RoomOptions
? There's also a field for configuring the capturer.. and I suspect the FPS there is incorrect
p
For added information, we tried both with H264 and VP8 with similar results and also chrome and firefox, perhaps a little better on firefox but certainly not in a significative amount. We even tried to simulate screenshare with an OBS virtual camera and results seemed significantly better.
Copy code
{
  "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"
    }
  }
}
d
thanks, let me give it a try with the same settings as above
p
thanks a lot
d
@purple-magazine-67414, I figured out the issue. This is because the default screenshare capturing resolution isn't specified, so it was essentially trying to compress a very large surface area. (compressing the entire screen without resizing first). I've opened a PR to address the default behavior moving forward, but for now you could set it explicitly when enabling the screen share:
Copy code
localParticipant.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.
p
Thanks a lot, this is very useful, we will make a try with this immediately
Thanks a lot for the indication, we have tested and it has improved although I am afraid up to a limit of 7-8 fps, depending on the type of content in the screenshare, the chirstmas video I shared above gets up to 7-10 fps , the skate one is much better
d
Are you able to try the PR above to see if it improves things?
with that branch I was getting 30fps on my tab shares
p
We tried just setting explicetely as you said, but we will check the PR. Thanks again
d
I also made a fix to unintentional reduction to fps in the secondary layers. (poor assumption we've made initially).
Not sure if that's the actual issue here.. but there shouldn't be any problems in getting to a similar fps as OBS virtual camera
p
That is great to know, we will try and let you know the results