W3C WebRTC
WG Meeting
October 17, 2023
8 AM - 10 AM
1
Chairs: Bernard Aboba
Harald Alvestrand
Jan-Ivar Bruaroey
W3C WG IPR Policy
2
Welcome!
3
About this Virtual Meeting
4
W3C Code of Conduct
5
Virtual Interim Meeting Tips
This session is (still) being recorded
6
Understanding Document Status
7
Issues for Discussion Today
Time control:
8
Congestion Control API (Harald)
Start Time: 08:10 AM
End Time: 08:30 AM
9
Encoded Transform Congestion Control: Why
So what does this mean for EncodedTransform?
10
Congestion Control: How?
https://github.com/w3c/webrtc-encoded-transform/pull/207
11
IDL of proposed API
interface mixin RTCRtpScriptSource {
readonly attribute ReadableStream readable;
Promise<unsigned long long> generateKeyFrame(optional DOMString rid);
Promise<undefined> sendKeyFrameRequest();
undefined sendBandwidthEstimate(BandwidthInfo info);
};
interface mixin RTCRtpScriptSink {
readonly attribute WritableStream writable;
attribute BandwidthInfo bandwidthInfo;
attribute EventHandler onbandwidthestimate;
attribute EventHandler onkeyframerequest;
};
[Exposed=DedicatedWorker]
interface RTCRtpScriptTransformer {
readonly attribute any options;
};
RTCRtpScriptTransformer includes RTCRtpScriptSource;
RTCRtpScriptTransformer includes RTCRtpScriptSink;
12
Blue: Restructuring for clarity
Yellow: New API pieces
Example API usage
Passthrough, but want to handle it myself:
transformer.onbandwidthestimate = (ev) => {
ev.preventDefault();
sendBandwidthEstimate(this.bandwidthInfo);
}
I’m adding a kilobyte per second:
Transformer.onbandwidthestimate = (ev) => {
Let temp = this.bandwidthInfo;
temp.allocatedBitrate -= 8000;
this.sendBandwidthEstimate(temp);
ev.preventDefault();
}
13
Not addressed in this proposal
14
Discussion (End Time: 08:30)
15
Mediacapture-screenshare (Elad)
Start Time: 08:30 AM
End Time: 08:50 AM
16
For Discussion Today
17
Contradictory hints - example #1
// Audio generally not requested,
// but system-audio marked as desired.
navigator.mediaDevices.getDisplayMedia({
audio: false,
systemAudio: "include",
});
18
Contradictory hints - example #2
// Audio requested, including an explicit
// request for system-audio,
// but monitors asked to be excluded.
navigator.mediaDevices.getDisplayMedia({
audio: true,
systemAudio: "include",
monitorTypeSurfaces: "exclude"
});
19
Contradictory hints - example #3
// Application requested monitors to be
// displayed most prominently,
// while simultaneously asking for monitors
// to not be offered.
navigator.mediaDevices.getDisplayMedia({
video: { displaySurface: "monitor" },
monitorTypeSurfaces: "exclude"
});
20
Handling of contradictory hints - proposal
Above is a snapshot of the getDisplayMedia algorithm in the spec.
Proposal:
21
Issue 281: Missing OS permissions - problem description
Sometimes screen-sharing is blocked because the user presses cancel; maybe the user changed their mind.
Sometimes screen-sharing is blocked because the OS permissions are configured to block. In that case, some applications might wish to explain that to the user.
22
Issue 281: Missing OS permissions - proposal
23
(The ctor sets the name attribute to the value “NotAllowedError”.)
Issue 281: Possible objection
Possible objection: “Shouldn’t the UA inform the user?”
Answers:
24
Discussion (End Time: 08:50)
25
Grab Bag (Henrik, Jan-Ivar & Fippo)
Start Time: 08:50 AM
End Time: 09:20 AM
26
For Discussion Today
27
PR #117: Add MediaStreamTrackAudioStats interface (Henrik)
track.stats now exposes video frame counters (delivered, discarded, total).
What about audio stats? Issue #96: Migrate capture metrics from RTCAudioSourceStats to MediaStreamTrack method.
The PR for this never landed due to discussions around API shape. New PR:
28
PR #117: Add MediaStreamTrackAudioStats interface (Henrik)
Delivered and dropped frames definition are similar to the video stats.
Measuring delay:
deliveredFramesDelay / deliveredFrames�is the average delay of each audio frame from capture to delivery.
Measuring glitches:
droppedFramesDuration / (deliveredFramesDuration + droppedFramesDuration)
is the percentage of audio that was dropped
(i.e. not processed in a timely manner).
Alternatively totalFrames instead of droppedFrames?
Where droppedFrames = totalFrames - deliveredFrames
For consistency with video stats.
29
Issue 972: Racy devicechange event design has poor interoperability (Jan-Ivar)
The devicechange event follows § 7.7. Use plain Events for state, but its "state information in the target object." is not available synchronously, a footgun: 🦶🔫
navigator.mediaDevices.ondevicechange = async () => {� const devices = await navigator.mediaDevices.enumerateDevices();� // 100+ milliseconds may have passed (letting devicechange fire multiple times!)� // The app compares devices vs. app.oldDevices to detect insertion/removal� app.oldDevices = devices; // stored state�}
100+ milliseconds may pass before the app examines devices, during which Chrome fires devicechange 7 more times (for putting on my AirPods). The async app code runs 8 times interleaved with itself. Any application state access becomes suspect.
Hard to reason about for no reason → Trial & error to pass QA → reliance on browser side-effects undetected → fails in the field in other browsers → poor interoperability.
30
Issue 972: Racy devicechange event design has poor interoperability (Jan-Ivar)
Proposal: Include the devices in the event:
navigator.mediaDevices.ondevicechange = ({devices}) => {� // The app compares devices vs. oldDevices to detect changes� app.oldDevices = devices;�}
Avoids all races and is 100% backwards compatible (modeled on trackEvent.streams).
31
Issue 966: Should devicechange fire when the device info changes? (Jan-Ivar)
The spec says: No.
�It indicates a change in devices available to the browser (i.e. OS change). Apps rely on it to support auto-switching in reaction to users inserting or removing devices during calls.�Safari incorrectly fires it as part of getUserMedia, confusing apps → poor interop.
32
Issue 966: Should devicechange fire when the device info changes? (Jan-Ivar)
To capture #966 discussion: imagine a rhetorical enumeratedevicechange event that fires for any delta in enumerateDevices output. It would include firing for non-OS reasons: changes in the site’s device information exposure or its permission.
Use case: Refresh an in-content picker
Option A: no change (workaround: app calls enumerateDevices after gUM)�Option B: add a new enumeratedevicechange event�Option C: change devicechange to work like enumeratedevicechange
Proposal: A
33
Issue 146: Exposing decode errors / SW fallback as an event
34
Issue 2888: setCodecPreferences vs. unidirectional codecs
35
Issue 2888: setCodecPreferences vs. unidirectional codecs
36
Issue 2888: setCodecPreferences vs. unidirectional codecs
Ready for PR?
37
Discussion (End Time: 09:20)
38
SDP Codec Negotiation (Harald)
Start Time: 09:20 AM
End Time: 09:40 AM
39
SDP Negotiation - The Model
40
Encoder
Transform
Packetizer
SDP�O/A
SDP negotiation - What To Do
Before negotiating with the peer, both sides of an app using a transform should:
Nothing in the platform understands those names; both sides have to add the same names.
If the peer agrees it understands those names, a PT will be assigned to it.
41
SDP negotiation - processing data
Before sending data:
Before receiving data:
The transform transforms, modifying metadata as needed.
42
Timeline of proposal
The result of the Oct 12 discussion was a number of arguments that suggested the whole approach should be rethought and different approaches considered. Some of those are now mentioned on the PR discussion.�A FAQ section has been added to the explainer on some of the choices.
43
Evaluation of status
44
Discussion (End Time: 09:40)
45
WebRTC Extended Use Cases
Start Time: 09:40 AM
End Time: 09:55 AM
46
For Discussion Today
47
Status of Section 3.2: Low Latency Streaming
48
Section 3.2.2: Low Latency Broadcast w/fanout
49
Section 3.2.2: Low Latency Broadcast w/fanout
50
PR 123: Section 3.2.2: Clarify Use Cases
51
Ready to merge?
Section 3.2.1: Game Streaming
52
Section 3.2.1: Game Streaming
53
Issue #103: Feedback related to WebRTC-NV Low Latency Streaming Use Case
54
PR 124: Requirement N38 is satisfied by jitterBufferTarget
55
Ready to merge?
PR 118: Clarify Game Streaming requirements (Section 3.2.1)
56
PR 118: Clarify Game Streaming requirements (Section 3.2.1)
57
ID | Requirement | Description | Benefits to Cloud Gaming | Is it Cloud Gaming Specific? |
N48 (New) | Recovery using non-key frames | WebRTC must support a mode allows video decoding to continue even after a frame loss without waiting for a key frame. This enables addition of recovery methods such as using frames containing intra coded macroblocks and coding units - WebRTC Issue: 15192 | Players can continue to game with partially intelligible video. Fast recovery from losses on the network | Can be used by any application where video corruption is preferred to video freezes |
N49�(New) | Loss of encoder -decoder synchronicity notification | The WebRTC connection should generate signals indicating to encoder about loss of encoder-decoder synchronicity (DPB buffers) and sequence of the frame loss.(RFC 4585 section-6.3.3: Reference Picture Selection Indication) - Delete of RPSI (Mar/2017) | Fast recovery from losses on network. Helps application to choose right recovery method in lossy network. | Can be used by any application where video corruption is preferred to video freezes |
N50�(New) | Configurable RTCP transmission interval | Application must be able to configure RTCP feedback transmission interval�- Need to set transmission interval for Transport-wide RTCP along with “WebRTC-SendNackDelayMs(field-trial)”. | Gaming is sensitive to congestion and packet loss resulting in higher latency. Consistent RTCP feedback helps application to adapt video quality to varying network (BWE and packet loss). | Can be used by any application where latency buildup is not acceptable. |
N51�(New) | Improve accuracy of Jitter buffer control | Extend adaptation of the jitter buffer to account for jitter in the pipeline upto the frame render stage - WebRTC Issue:15535 | Increases accuracy of jitter buffer adaptation and helps maintain consistent latency | Helps all low latency applications, but is necessary for Cloud gaming |
N48 and N49: Recovery using non-key frames (cont’d)
58
N48 and N49: Recovery using non-key frames (cont’d)
59
N50: Configurable RTCP transmission interval (cont’d)
60
N51:Improve accuracy of Jitter buffer control
61
Discussion (End Time: 09:55)
62
Wrapup and Next Steps
Start Time: 09:55 AM
End Time: 10:00 AM
63
Title Goes Here
64
Thank you
Special thanks to:
WG Participants, Editors & Chairs
65