# How to determine selected spatial layer in simulcast?

**URL:** <https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894>\
**Category:** Support\
**Created:** [February 18, 2019, 6:20pm UTC](https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894 "2019-02-18T18:20:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [February 18, 2019, 6:20pm UTC](https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894/1 "2019-02-18T18:20:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Valeriy](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@Valeriy](https://discourse.lynckia.com/u/Valeriy)\
**Post date:** [February 21, 2019, 10:20am UTC](https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894/2 "2019-02-21T10:20:08Z")

</div>

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):  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/lynckia/original/1X/ed151cf7d0a78f6228018d69ab0cb6ce68ca5a7e.png)

---

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [February 21, 2019, 2:26pm UTC](https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894/3 "2019-02-21T14:26:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Valeriy](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@Valeriy](https://discourse.lynckia.com/u/Valeriy)\
**Post date:** [February 22, 2019, 9:30am UTC](https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894/4 "2019-02-22T09:30:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [February 22, 2019, 10:38am UTC](https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894/5 "2019-02-22T10:38:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [February 26, 2019, 6:37am UTC](https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894/6 "2019-02-26T06:37:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Valeriy](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@Valeriy](https://discourse.lynckia.com/u/Valeriy)\
**Post date:** [March 1, 2019, 4:01pm UTC](https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894/7 "2019-03-01T16:01:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [March 1, 2019, 4:30pm UTC](https://discourse.lynckia.com/t/how-to-determine-selected-spatial-layer-in-simulcast/894/8 "2019-03-01T16:30:18Z")

</div>

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