How to control simulcast layers when the network quality changes?

I use 3 layers with bitrates of 120, 400 and 1660 kbps.

I would like to use updateSendSettings to control which layers a participant should publish in the following way:

I would like to send 3 layers by setting maxQuality as high when network threshold is good.

Send 2 layers by setting maxQuality as medium when network threshold is low.

Send 1 layer or turn off local camera by setting maxQuality as low when network threshold is very low.

Please correct me if this is not a proper way to do or suggest if you have any alternatives.

But I am facing an issue in following the above approach . Because I get network threshould as good even when the max uplink bandwidth is 300 kbps which I set using network link conditioner. So with this threshold as good and quality as 10 at 300kbps uplink. the maxQuality will be set as high and 300 kbps is not sufficient for sending 3 layers. Sometimes I do get threshold as low and quality as 9 at 300kbps uplink.

Or should I also consider any other parameters from network stats such as quality or avaipableOutgoingBitrate from network stats?

Answers

  • I use 3 encodings
    encodings: {
    low: {
    maxBitrate: 120 * 1000,
    scaleResolutionDownBy: 4,
    maxFramerate: 15,
    },
    medium: {
    maxBitrate: 400 * 1000,
    scaleResolutionDownBy: 2,
    maxFramerate: 24,
    },
    high: {
    maxBitrate: 1660 * 1000,
    scaleResolutionDownBy: 1,
    maxFramerate: 24,
    }
    }


    I would like to use updateSendSettings to control which layers does a participant should publish
    I would like a participant to publish
    1. all the 3 layers by setting maxQuality as high, when the network threshold is good and when there is enough bandwidth available for publishing videos such as 2180 kbps (1660 for 2nd layer +400 for 1st layer+120 for 0th layer)
    2. only low and medium layers by setting maxQuality as medium, when the network threshold is low and when there is enough bandwidth available for publishing videos such as 520 kbps (400 for 1st layer+120 for 0th layer)
    3. only last layer by setting maxQuality as low, when the network threshold is very-low and and when there is enough bandwidth available for publishing videos such as 120 kbps for 0th layer
    mute local camera if there is no bandwidth available for sending atleast the low layer of 120 kbps.



    I used networkLinkConditioner for simulating different networks.
    I am testing with only one participant. I run call by setting topology as SFU. And I set uplink as 300kbps in networkLinkConditioner. I didn’t give any limit for downlink.

    I considered only network threshold parameter for checking network quality.

    I thought I can set maxQuality as high so that I can send all the 3 layers(2nd layer with 1660kbps, 1st layer with 400kbps and 0th layer with 120kbps) ,when the network threshold is good. But I am wrong, because I am getting network threshold as good even when I set uplink bandwidth as 300kbps using networkLinkConditioner (which is not sufficient for sending all the 3 layers). And also from the stats I can see another parameter availableOutgoingBitrate as 308000 which is near to the uplinkBandwidth I set using networkLinkConditioner.

    same way I though to set maxQuality as medium and low when the network thresholds were low and very-low. I am wrong here as well.


    1. At availableOutgoingBitrate = 300kbps, I am getting network thresholds as high when quality ranges from 11 to 100,
    2. At availableOutgoingBitrate = 300kbps, I am getting network thresholds as low when quality is 8 to 10.
    3. At availableOutgoingBitrate = 300kbps, I am getting network thresholds as very-low when quality is <= 7. these values changes sometimes.

    Daily's default video encodings:
    encodings: {
    low: {
    maxBitrate: 90 * 1000,
    scaleResolutionDownBy: 4,
    maxFramerate: 15,
    },
    medium: {
    maxBitrate: 200 * 1000,
    scaleResolutionDownBy: 2,
    maxFramerate: 15,
    },
    high: {
    maxBitrate: 680 * 1000,
    scaleResolutionDownBy: 1,
    maxFramerate: 30,
    }
    }

    after I see these above Daily’s default-video encodings, I though I would get
    1. network threshold as good when uplink bandwidth or availableOutgoingBitrate as around 600-800kbps.
    2. network threshold as low when uplink bandwidth or availableOutgoingBitrate as around 300-500kbps.
    3. network threshold as very-low when uplink bandwidth or availableOutgoingBitrate as around 100-300kbps.
    But I am wrong here as well.

    Am I following the correct way of update send settings? If so, should I continue by following only the network threshold parameter for update send settings or should I also follow quality and availableOutgoingBitrate parameters or any other parameters from network stats? Or Should I test with 3-4 participants in a call?

    If I am wrong please suggest proper way of update send settings.
    Thanks 🙂🙏