Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For optimal picture quality with available channel bandwidth video bitrate should be managed while capturing WebRTC stream in browser. WCS server allows to limit minimum and maximum video bitrate for stream published. Audio bitrate is not managed.

WCS builds before 5.2.1825 use REMB to manage a publishing bitrate. Since build 5.2.1825 TWCC is used by default.

Platforms and browsers supported


Chrome

Firefox

Safari 11

Edge

Windows

+

+


+

Mac OS

+

+

+


Android

+

+



iOS

-

-

+


Settings

REMB

Since build 5.2.1825 REMB support should be enabled by the following parameter

Code Block
themeRDark
webrtc_cc2_twcc=false

The following WCS settings are intended to limit publishing bitrate:

...

These settings work in most modern browsers and define the REMB bitrate management limits.

How it works

If maxBitrate is set, WCS server will send REMB command to decrease bitrate when this limit is reached.
If minBitrate is set, WCS server will stop sending REMB command to decrease bitrate when this limit is reached.
Therefore, the settings define 3 ranges with its own bitrate management algorithm:

RangeAlgorithm
1[0, minBitrate]

WCS stops bitrate management and not send any REMB commands

2[minBitrate, maxBitrate]

WCS server makes active bitrate management: depending on jitter and incoming traffic uniformity WCS decides to send REMB commands to decrease bitrate. If channel is good, WCS does nothing and bitrate is not decreasing

3[maxBitrate, ...] 

WCS constantly sends bitrate decrease commands until it reduce to maxBitrate

TWCC

Since build 5.2.1825, TWCC is enabled by default

Code Block
themeRDark
webrtc_cc2_twcc=true

When TWCC is used, bitrate may be limited via publishing constraints at browser side only, in kbps

Code Block
languagejs
themeRDark
constraints.video.minBitrate=500
constraints.video.maxBitrate=1000

TWCC bitrate settings work in Android SDK 1.1.0.62, iOS SDK 2.6.122 and WebSDK 2.0.239.

How to enforce bitrate increasing

Now, bitrate increasing can be enforced in Chrome browser Chromium browsers only by setting x-google-max-bitrate and  x-google-min-bitrate parameters via SDP hook.
It is impossible to enforce bitrate rising with client and server settings, only bitrate decreasing can be managed.
In this case, Chrome specific settings take precedence if they are set, i.e. constraints and server settings will be ignored. Note that Chrome default settings found by experience is

Code Block
themeRDark
x-google-max-bitrate=2500

In the latest Chrome builds, the option videoContentHint: "motion" should be set when enforcing bitrate on browser side, because Chrome drops publishing bitrate in prefer to resolution when one of the other values is set

Code Block
languagejs
themeRDark
    session.createStream({
        name: streamName,
        display: localVideo,
        ...
        videoContentHint: "motion"
    }).publish();

Enforcing bitrate increasing in Chrome browser with server parameters

...

These settings are intended for Chromium-based browsers and work with, e. g., Opera, Vivaldi and Yandex.Browser. Also, they are applied when iOS Safari 12 or newer is used. They do

Bitrate enforcing does not work with in Firefox and Edge.

Usage

Bitrate limiting in certain borders can be useful for example when publishing video to Safari browser subscribers. This browser is sensitive to bitrate jumps, in this case picture quality loses until freeze and browser hangs. It is recommended to stabilize bitrate when publishing streams for Safari viewers by setting narrow limits of bitrate change, for example

...