Chrome resolution ramp-up

Cmm

New Member
Hi,

Since Chrome 91 some WebRTC settings have been changed and with other platforms we're experiencing low quality recordings (we cannot record 1280x720px because Chrome forces a ramp-up in resolution). Are you experiencing the same problems or have you solved them somehow?
We're looking for a solution to record in HD from first second.
In your demo I can only test with low quality recordings.
Thanks.
 

Max

Administrator
Staff member
Good day.
You can set the desired publishing resolution and bitrate via constraints:
Code:
session.createStream({
    name: streamName,
    display: localVideo,
    cacheLocalResources: true,
    constraints: {
           video: {
                  width: 1280,
                  height: 720,
                  minBitrate: 1000
           },
           audio: true
    }
}).on(STREAM_STATUS.PUBLISHING, function (stream) {
    ...
}).publish();
Please note that browser can start publishing from lower resolution than set in constraints if publisher channel is not good enough to send a stream with requested parameters.
 

Max

Administrator
Staff member
We reproduced the problem in Chrome 91.0.4472.164 and raised the ticket WCS-3257 to investigate the issue.
Please use other browser as workaround.
 

Cmm

New Member
We confirm this to be Chromium bug https://bugs.chromium.org/p/webrtc/issues/detail?id=12942&sort=-modified
The workaround is to disable hardware acceleration in Chrome settings.
There is also another workaround using experimental MediaTrack option. We will check this.
No, no, watch out. That's a different but related issue.
There are 2 issues:
  1. Chrome 91 ramp-up from 640p to 1280p. That's a problem for recording since you have to wait until you get 1280p, otherwise the whole record (or at least quite a few seconds) will be recorded in 640p or getting video freezing (depending on the container format and technology you use to record). That's the main issue we're concerned with (https://bugs.chromium.org/p/webrtc/issues/detail?id=12872).
  2. Even if you manage to solve the recording issue, when HW acceleration is on, some Chrome 91 in Windows cannot record without a workaround (https://bugs.chromium.org/p/webrtc/issues/detail?id=12942&sort=-modified).
 

Max

Administrator
Staff member
There are 2 issues:
The reason for both the issues is the same: Chrome aggressive quality measure on publishing start. So the only workraound at the moment seems like to disable HW acceleration (this may not help in some Chromium based browsers, Yandex.Browser ror example) and wait for about 10 seconds after publishing for resolution to raise. This can be checked using stream metrics REST API.
Another option is to republish WebRTC stream as RTMP locally with transcoding to desired resolution:
Code:
POST /rest-api/push/startup HTTP/1.1
Host: localhost:8081
Content-Type: application/json
 
{
    "streamName": "webrtc_stream",
    "rtmpUrl":"rtmp://localhost:1935/live/rtmp_stream",
    "rtmpTransponderFullUrl": true,
    "width": 1280,
    "height": 720
}
and to record republished stream rtmp_stream. But this requires more CPU cores: 1 CPU core per 2 720p streams.
 

Max

Administrator
Staff member
We found a workaround using contentHint and already testing it. Will let you know when Web SDK fix will be released.
 

Max

Administrator
Staff member
Good day.
To workaround this behaviour, since WebSDK build 2.0.180 videoContentHint option was added. Bu default, is is set to detail, this forces Chrome to keep publishing resolution. Please read details here.
 
Top