How to determine selected spatial layer in simulcast?

When simulcast is enabled how to find the selected spatial layer for specific subscriber? Is there such report in Chrome webrtc-internals?

I’m not sure about direct information, but you can identify it by receiving video resolution.
For example here we can see that width changed from 320 to 640 (layer 0 to layer 1):

Thanks for the tip. Actually I’m getting the full resolution but with lower quality than when simulcast is disabled. I’m testing in local environment with one participant and 3 spatial layers. Is that normal?

Yes, it is normal. You are sharing bandwidth with layers.
Let’s say you have publisher bandwidth = 500kbps. If you have 1 layer (no simulcast), you are using all 500 kbps per stream. If you have 3 layers, then you share 500 kbps between those layers. So maximal layer will have ~ 375 kbps.

Ah that’s exactly what I’m experiencing! I never thought about the bandwidth. Thank you @Valeriy. I learned a new thing today. :pray: :pray:

I’m wondering if is it possible to enable/disable the simulcast or even set the number of spatial layers over a published stream? This way we would be able to manage the bandwidth/quality more efficiently. For example in a one to one scenario we better to disable the simulcast to achieve a higher quality by using the whole bandwidth and when more participants joined then we can enable the simulcast and increase the number of spatial layers accordingly.

Do you mean this?
room.publish(localStream, {simulcast: {numSpatialLayers: 2}});

Yes but dynamically changing the number of layers without having to stop and republish the stream.