update maxBitrate for live stream

sulphur

Member
Hi,
I was wondering whether it is possible or not to apply new constraints to a publisher live stream. For example, I would like to implement a simple auto-quality functionality. The goal is to decrease (or increase) the quality without the need to restart the stream. So for example if I publish the stream with constraints like :
Code:
   constraints.video = {
      width: width,
      height: height,
      maxBitrate: 2048,
      minBitrate: 600
    }
I would like to apply new constraints to a live stream with a lower maxBitrate for example : maxBitrate=1024 if detect that my QUALITY is BAD for some long period of time.

best regards
Piotr
 

Max

Administrator
Staff member
Good day.
I was wondering whether it is possible or not to apply new constraints to a publisher live stream
It is impossible. All the constraints are set in browser using WebRTC API, then browser starts to capture a stream from webcam (or screen). While stream is capturu=ing, constraints cannot be changed. So you have to republish the stream with a new constraints if changes needed.
I would like to implement a simple auto-quality functionality
You can implement a channel quality control, but you should republish stream if channel state becomes BAD.
 

sulphur

Member
Hello,
Thank you for the reply. Yes, that what I did in meantime if BAD% > XX then stop()/start().

What I did also is that I've set the maxBitrate per resolution. I have a question regarding the minBitrate. I saw somewhere in the docs that to avoid some safari flicking issues you recommend that max and min are the same. Is it a generally good approach?
For example, I'm wondering what will yield better results setting Min and Max bitrate to same values ( or very close) or is it better to a bigger gap for example minBitrate=300 and maxBirtate=1024 for a 1Mbps stream.
 

Max

Administrator
Staff member
I saw somewhere in the docs that to avoid some safari flicking issues you recommend that max and min are the same. Is it a generally good approach?
This is not good approach. Browser should have a gap to drop bitrate if channel quality falls, or stream can freeze.
For example, I'm wondering what will yield better results setting Min and Max bitrate to same values ( or very close) or is it better to a bigger gap for example minBitrate=300 and maxBirtate=1024 for a 1Mbps stream.
The second is better.
 
Top