1 of 125

WEBRTC WG Meetings

TPAC

November 6-7, 2017

Burlingame, CA

1

Chairs: Stefan Hakansson

Bernard Aboba

Harald Alvestrand

2 of 125

Welcome to the WebRTC WG Meetings at TPAC!

  • WebRTC-PC has been published as a Candidate Recommendation!
  • Goal of this meeting is to make progress on remaining WebRTC-PC, Media Capture and Depth Capture issues and to discuss how the WG should proceed going forward, including:
    • Testing
    • Progress toward PR for WebRTC-PC and Media Capture
    • New work

2

3 of 125

W3C WG IPR Policy

3

4 of 125

About These Meetings

4

5 of 125

Monday TPAC Agenda

  • 8:30 - 9:00 Agenda bashing
  • 9:00 - 10:30 Public session on WebRTC Testing (Alexandre, Huib, Soares)
    1. Test suite
    2. Introduction to the new testing tool
  • 10:30 - 11:00 Coffee
  • 11:00 - 11:30 Test-driven development (Philip Jägenstedt)
  • 11:30 - 13:00 WebRTC-PC Issues (Bernard, Peter)
  • 13:00 - 14:00 Lunch break
  • 14:00 - 15:00 WebRTC-stats (Varun, Harald)
  • 15:00 - 15:30 Coffee break
  • 15:30 - 17:00 Media Capture Main (Dan, Jan-Ivar)

5

6 of 125

Tuesday TPAC Agenda

  • 8:30 - 9:00 Agenda bashing
  • 9:00 AM - 10:30 AM Media-Capture
  • 10:30 AM - 11:00 AM Coffee break
  • 11:00 AM - 12:00 PM WebRTC and WebRTC-stats next steps
  • 12:00 PM - 1:00 PM Lunch
  • 1:00 PM - 3:00 PM WebRTC new work
    • New functionality (QUIC, SVC)
    • Discussion of working methods and how to get started on NV
  • 3:00 - 3:30 PM Coffee break
  • 3:30 PM - 4:30 PM Wrap-up and action items

6

7 of 125

WebRTC Testing

W3C TPAC

November 6, 2017

Burlingame, CA

7

Presenters: Huib, Alexandre, Soares

8 of 125

About This Session

  • WebRTC testing has potential impact beyond the W3C standards community, so we have opened this session to the developer community at large.
  • The meeting is being recorded.
  • WebEx info here

8

9 of 125

Path to WebRTC 1.0

Specs

Tests

Compliance

Reliability

huib

10 of 125

Spec status

W3C

IETF

WebRTC 1.0

CR

JSEP

→ RFC

Media Capture and Streams

CR

Data Channel

~RFC

Identifiers for WebRTC's Statistics

WD

RTP Usage

~RFC

Transports

~RFC

Audio/Video codecs

RFC

Requirements

RFC

11 of 125

Tests tracks: WPT and Interop testing

javascript

HTTP

SRTP/SCTP

STUN/TURN

javascript

javascript

Web Platform Tests

KITE

12 of 125

Compliance

Webrtc.org status

  • Available: Spec-compliant getStats, MediaStreamTrack constraints, RTCRtpReceiver
  • Experimental: RTCRtpSender, addTrack, ontrack
  • Under development: Unified Plan

ETA: mostly completed end of Q1 2018

  • Challenging for application developers without consistent compliance, native path chosen instead

13 of 125

Reliability

  • Reliability and performance are critical
  • Harder to get right than spec compliance
  • Typical issues
    • Failing audio/camera subsystems
    • Jitter due in overloaded browser
    • Performance regressions across browsers

14 of 125

Web Platform Tests Progress

  • May 2017: 293 tests
  • Nov 2017: 1296 tests (+1003)

15 of 125

Coverage Status - 2017

  • PR #8051: Add coverage report and tools for WebRTC tests
  • Coverage = (total - todo) / total

$ cd webrtc/tools

$ node scripts/overview.js

Overall Coverage�====================�todo | 248�tested | 315�trivial | 173�untestable | 79�====================�total | 815�coverage | 69.57%�====================

4. Peer-to-peer connections

67.83%

5. RTP Media API

67.01%

6. Peer-to-peer Data API

71.87%

7. Peer-to-peer DTMF

93.54%

8. Statistics Model

100.00%

9. Identity

86.04%

10. Media Stream API Extensions for Network Use

35.71%

16 of 125

Challenges to reach 100% coverage

  • Missed out (124)
    • Difficulty to keep track of coverage, until now
  • New steps added (97)
    • Long update between editor’s draft
    • Most tests based on 20170605 draft - 5 months lag by now
    • Issue #942 fixes this hopefully
  • Race conditions (20)
    • Difficult to test correctly

17 of 125

Path to 100% coverage

  • Straightforward tests to reach 90%
    • New steps resolved most testing issues
  • Remaining 10% take some extra time
    • Tests involving other specs: SDP, ICE, HTML5, etc
  • We should reach 100% by Q1 2018

18 of 125

Next Steps

  • Coverage != correctness
    • Several issues have been reported to fix incorrect tests
    • Need validation from implementers and spec authors
  • Discuss ways to keep track of coverage
  • Automation with WebDriver & permissions API
  • Testing other specs?
    • mediacapture-main ✔
    • mediastream-recording ?
    • Mediacapture-depth ?
    • Mediacapture-fromelement ?

19 of 125

Interop testing

19

20 of 125

Thank you

Special thanks to:

W3C/MIT for WebEx

Huib, Dr. Alex, Soares

20

21 of 125

Test As You Commit Policy

W3C TPAC

November 6, 2017

Burlingame, CA

21

Presenters: Bernard

22 of 125

For Discussion in this session

  • Issue 1617: Adopt “test as you commit” policy (foolip)

22

23 of 125

Issue 1617: Adopt “test as you commit” policy (foolip)

  • WebRTC test suite is already in pretty good shape: https://rwaldron.github.io/webrtc-pc/
  • https://wpt.fyi running all tests
  • Imported into at least Chromium, Gecko and WebKit
  • We’re working on automation
  • Similar policy already adopted by many other groups.

23

24 of 125

rwaldron.github.io/webrtc-pc/

24

25 of 125

wpt.fyi (soon much less red)

25

26 of 125

Automation using WebDriver

26

27 of 125

Testing policy adoption (>50%!)

27

28 of 125

WebRTC-PC Session

W3C TPAC

November 6, 2017

Burlingame, CA

28

Presenters: Peter, Bernard

29 of 125

For Discussion in this session

  • WebRTC-PC Issues
      • Issue 1194: AudioLevel of tracks, both send and receive (Peter)
      • Issue 1586: behavior of OfferToReceive* set to false (Jan-Ivar)
      • Issue 1625: RTCPriorityType combines relative bitrate with QoS priority, which applications may not want (Peter)
      • Issue 1635: Need for initial bitrate by the application/RtpSender (Peter)
      • Issue 1644: Adding more values to RTCIceTransportPolicy Enum (Peter)
      • Issue 1646: Isolated Media Streams require modification to permission algorithms (soareschen)

29

30 of 125

Issue 1625/PR 1632: RTCPriorityType undesirably combines relative bitrate with QoS priority (Peter)

Problem: You want to send something with high priority for QoS but with fewer bits.�RTPEncodingParameters.priority controls both and makes higher QoS = more bits

Examples:

  • Change the DSCP markings without changing the bits
  • Change the bits without changing the DSCP markings
  • Send low-bitrate/high-QoS audio with a high-bitrate/low-QoS audio
  • Send low-bitrate/high-QoS video with a high-bitrate/low-QoS video
  • Send low-bitrate/high-QoS audio with a high-bitrate/low-QoS video

Also: the ratios of 1:2:4:8, are not granular enough to be very useful.

30

31 of 125

Issue 1625/PR 1632: RTCPriorityType undesirably combines relative bitrate with QoS priority (Peter)

Proposal: break up "more bits" and "higher QoS" into two separate controls

  • Existing RtpEncodingParameters.priority is for "higher QoS"�(It's like "QoS priority")
  • New RtpEncodingParameters.relativeBitrate is for "more bits"�(It's like "bits priority")

PR 1632:

relativeBitrate of type double

Indicates the relative amount of bitrate that this encoding should be allocated when congestion occurs, relative to other encodings being sent under the same congestion control regime. For example, if two encodings use values of 1.0 and 1.5, respectively, and the congestion controller determines that 5Mbps are available to allocate, the encodings should be allocated 2Mbps and 3Mbps, respectively. The encoding may also be further constrained by other limits (such as maxBitrate or per-transport or per-session bandwidth limits), resulting in it using less than its available share.

31

32 of 125

Issue 1625/PR 1632: RTCPriorityType undesirably combines relative bitrate with QoS priority (Peter)

Peter's recommendation: split "priority" into "QoS priority" and "bitrate priority". More flexible bitrate ratios via "relativeBitrate" seems like an elegant solution and nice bonus.

32

33 of 125

Issue 1635: Need for initial bitrate by the application/ RtpSender (Peter)

Should we add a way for the app to say "I think the bandwidth estimate is X. Start there"?

If so, where does it go and what does it mean? It's complicated.

  • RTCConfig: What does getConfig() return? What does setConfig(getConfig()) do?
  • New method on PeerConnection? What about WebRTC NV?
  • New method on IceTransport? It's more of an RTP thing than an ICE thing.
  • New method on RtpSender? But it applies to all senders.

What if you're not bundling? �What does it do to SCTP? �What happens if you switch ICE network routes?

33

34 of 125

Issue 1635: Need for initial bitrate by the application/ RtpSender (Peter)

Peter's recommendation: Leave it out (for now?). We can try something in WebRTC NV (perhaps we'll have a separate RtpTransport where this would make sense).

34

35 of 125

Issue 1194: AudioLevel of tracks, both send and receive (Peter)

Would RTCRtpReceiver.getSynchronizationSources() be useful for getting the audio level of the last sent packet?

Or would it make more sense to get the audio level from RTCRtpReceiver.track (either using WebAudio or adding a new event to MediaStreamTrack)?

35

36 of 125

Issue 1194: AudioLevel of tracks, both send and receive (Peter)

Peter's recommendation: leave it off RtpSender. Put it on MediaStreamTrack, or just let WebAudio handle it. Even the initial bug reporter (Henrik Bostrom) said that's fine.

36

37 of 125

Issue 1644: Adding more values to RTCIceTransportPolicy Enum (Peter)

Two separate things going on:

  1. Data-channel-only applications want a way to get more candidates than the default behavior without going all the way to using getUserMedia to get all of them. This is something we've talked a lot about before.
  2. Applications may want a way to constrain the candidates to something less than "all" and more than "relay". For example, "all for the default route, and relay for the others". This could not always be accomplished by JS filtering candidates, but it could maybe be accomplished by allowing JS to force the browser into a lower permission state than it has otherwise granted ("Even if I have been granted access through getUserMedia, pretend I haven't been and do your default thing"). This is something we've talk a lot about before.

37

38 of 125

Issue 1644: Adding more values to RTCIceTransportPolicy Enum (Peter)

Peter's recommendation: Leave it out. Maybe try to handle it with the permissions spec.

38

39 of 125

Issue 1586: behavior of OfferToReceive* set to false (Jan-Ivar)

History: offerToReceive was removed when Transceivers were introduced

    • Not needed; same functionality available with transceiver.direction attribute
    • {offerToReceiveAudio: true} (and video) as a way to offer to receive audio/video (even though not intending to send) later re-introduced
    • However 3 browsers support {offerToReceiveAudio: false} = sendonly
    • Usage: Broadcast; “I want to send audio but not receive it” offer and other end-point isn’t browser (= doesn’t know to reply with recvonly)
    • Complex to specify - Usage?

Questions:

  • 1) Should we re-introduce {offerToReceiveAudio: false} as a way to make the SDP indicate you are not willing to receive even though you’re sending?
  • 2) Spec currently disallows browsers to continue legacy support. Allow?
  • “In all other situations, it MAY be disregarded.”?

39

40 of 125

Issue 1646: Isolated Media Streams require modification to permission algorithms (soareschen)

  • The peerIdentity field in MediaStreamConstraints allows applications to request for media device permission for specific peerIdentity only
  • Permission algorithms are specified in mediacapture-main and w3c/permissions
    • Not taken in consideration of peerIdentity constraints
  • peerIndentity-specific permission grant may not be reused for subsequent request for general usage
  • Caching algorithms only use media kind and deviceId as keys
  • Multiple Options
    • Modify other specs?
    • Augment algorithms from webrtc-pc?
    • Remove peerIdentity-specific permission prompt?
    • Suggestions?

40

41 of 125

WebRTC-Stats Session

W3C TPAC

November 6, 2017

Burlingame, CA

41

Presenters: Varun, Harald

42 of 125

We’ve made a lot of progress

  • 3 updates:
    • 14 December 2016, 30 March 2017, 14 June 2017
    • 120 issues closed.
    • Many thanks to contributors, especially: Henrik, Taylor, and Jan-Ivar.

43 of 125

Major changes

  • Added new RTCStatsType
    • csrc, split some of the RTP objects into local and remote objects
  • Added a section on Obsolete Stats
    • Current reason is renaming and unit changes
    • rtt had ambiguous units - some used milliseconds and others used seconds, was changed to to be in seconds as per RFC3550 and was renamed roundTripTime.

44 of 125

Path to CR

  • Need review on the existing document
    • From implementers (naturally)
    • From users of stats (important!)
  • Get Security and Privacy section in a better shape
  • 30 Open issues
    • 6 icebox issues
    • Some of these will get done, however, others require much wider review or discussions → to make sure some of these get resolved in time for CR.
    • Example: concealedAudibleSamples in review for a few months. https://github.com/w3c/webrtc-stats/pull/215

45 of 125

Open issues to discuss at this meeting

  • Structural issues - guidelines for new stats, format of specs
    • Need input from spec-writers/readers and folks who know how to do process
    • May be CR blockers
  • Stats proposed that are hard to clearly define
    • Need subject matter expert input
    • Not CR blockers
  • CR blockers: 99/251, 177/243, 131/262, 231, 230
    • Issue 99/PR 251: Security and privacy considerations
    • Issue 177: Caching and consistency of getStats()
    • Issue 131/PR 262: “objectDeleted” marker
    • Issue 231: Sender and Receiver stats vs Track stats
    • Issue 230: RTCMediaStreamTrackStats to 4 dicts
    • Any others?

46 of 125

Issue 99/PR 251: Security and privacy considerations

  • CR blocker
  • Self analysis done by Harald and Varun,
  • Does this specification expose any other data to an origin that it doesn’t currently have access to?
    • The properties exposed by `RTCReceivedRTPStreamStats`, `RTCRemoteInboundRTPStreamStats`, `RTCSentRTPStreamStats`, `RTCOutboundRTPStreamStats`, `RTCRemoteOutboundRTPStreamStats`, `RTCIceCandidatePairStats`, `RTCTransportStats` expose network-layer data not currently available to the JavaScript layer.

47 of 125

Issue 99/PR 251: Security and privacy considerations

  • Does this specification allow an origin access to a user’s location?
    • For instance, the [round-trip time] exposed in `RTCRemoteInboundRTPStreamStats` can give some coarse indication on how far aparts the peers are located, and thus, if one of the peer's location is known, this may reveal information about the other peer.

47

48 of 125

Issue 177: Caching and consistency of getStats()

  • CR blocker
  • Proposal: Require objects to have updated stats after object state transitions; permit some caching when there is no state transition.
  • PR #243
    • When the state of the PeerConnection visibly changes as a result of an API call, a promise resolving or an event firing, subsequent new getStats() calls MUST return up-to-date dictionaries for the affected objects.
    • For example, if a track is added with addTrack() subsequent getStats() calls MUST resolve with a corresponding RTCMediaStreamTrackStats object. If you call setRemoteDescription() removing a remote track, upon the promise resolving or an associated event (stream's onremovetrack or track's onmute) firing, calling getStats() MUST resolve with an up-to-date RTCMediaStreamTrackStats object.

49 of 125

Issue 131/PR 262: “objectDeleted” marker

This reflects explicitly the model that stats exist for objects that are gone.

Is this marker useful? Correctly defined?

CR blocker?

Editors think this is ready to merge.

50 of 125

Issue 231/PR 273: Sender & Receiver stats vs Track stats

  • CR BLOCKER

Track stats were introduced before senders/receivers. Later we made each track per-attachment to the PC, a compromise. A more accurate view is to have stats per sender, receiver and track objects.

This is an issue because ReplaceTrack will make the two stats different

Much simpler, removes the need for detached, and accumulation of stale objects.

Have to decide one way or the other where we want to end up

Might present all stats on both objects for a while as a transition strategy?

51 of 125

Issue 230/PR 272: RTCMediaStreamTrackStats to 4 dicts

  • CR blocker (even though not visible on the wire)

Removes "Only valid for..." prose in nearly every RTCMediaStreamTrackStats member by using WebIDL instead (dictionary inheritance).

kind and remoteSource stay. API unaffected. Minor JS observable change (order).

(If we go for #231 remoteSource disappears naturally: remoteSource == "receiver").

Editors like it.

52 of 125

Issue 133/135: DSCP information

Not CR blocker

Gives information that can diagnose remarking and codepoint-blocking problems.�Belongs on RTCTransportStats or RTCIceCandidatePairStats?�Information is not accessible on all platforms.

Proposal: Add a record<USVString, long>, where key is the DSCP codepoint in string-numeric form and the value is # of packets sent / received with that marking.

Alternative: define an interface that is a maplike<short, long>, where key is DSCP codepoint and value is # of packets sent/received.

53 of 125

Issue 202: concealedAudibleSamples

Concealed samples are samples synthesized to conceal packet loss.

concealedAudibleSamples are such samples synthesized during “audible” portions of the stream, such as when someone is speaking.

Hard to find a definition on “audible” that’s comprehensible and supportable.

PR #215 is a proposal

Not a CR blocker

54 of 125

Issue 1613: Stats and Isolated Streams (varun)

  • Some aspects (like volume) allow JS to learn stuff about what goes on inside isolated streams (see RFC 6562 for a similar case involving RTP)
  • Two possible approaches:
    • a) Minimize the information leaked (e.g by dithering, caching) and live with it
    • b) Do not report sensitive stats on isolated streams, live without it
  • Suggested approach: b) List sensitive items in doc, say “will not report on isolated streams”
    • Sensitive items beyond “volume” need suggesting!

54

55 of 125

SVC use cases

for an SFU developer

Sergio Garcia Murillo - CosMo Software

56 of 125

SVC Use cases

Simulcast and SVC use cases are very similar (if not identical): content adaptation without transcoding

Adaptation will happen as a combination and/or trade off of the following items:

  • Bitrate
  • Image size
  • FPS
  • Quality
  • Decoding complexity

Typically you would always love to have the best quality, with biggest image size and most fps, but most of the times you have will be restricted to do that and have to adapt video stream to the match certain limits.

Also, another interesting use case would be for increasing reliability against packet losses by applying different protection levels to each layer and maximizing the probability that at least the base layer is received.

57 of 125

Content Adaptation (I)

Bitrate adaptation is the most common one:

  • Each participant on a multiconference will have different available bandwidth so the SFU must select the appropriate layers to forward to each participant based on the bandwidth estimation.
  • The SFU will either choose to select a lower spatial layer (reducing image size/quality) or temporal layer (reducing fps) depending on its business logic.

Image size adaptation is also very common:

  • The SFU will optimize network and cpu resources by sending a lower resolution matching the UI needs and service logic requirements.
  • Typically the SFU will forward a bigger image for the active speaker than the non-active ones.

58 of 125

Content Adaptation (II)

Adapt on FPS and/or Quality

  • I have not found any use case for them (Thumbnailing?).
  • Typically it is a trade off in other uses cases: When adapting bitrate, what should be preserved quality or movement?

Adapt based on decoding complexity

  • Sometimes you do not want to overflow low end devices (mobile phones most probably).
  • Combination of image size and fps adaptation.

59 of 125

What do SFU developers need?

  • Enabling/Disabling temporal/spatial scalability (or simulcast/temporal scalability).
  • Set desired targets on image size (not really on fps or bitrate).
  • Set desired granularity for adaptation (number of layers/steps or and relative difference between them in terms of bitrate/fps/size).
  • Set priority between encodings/layers to control how they prefer to degrade quality/movement and/or split bitrate between.
  • We don't really care about dependencies between layers really, it is a codec thing.

60 of 125

Media Capture Session

W3C TPAC

November 6-7, 2017

Burlingame, CA

60

Presenters: Peter T, Jan-Ivar, Peter B

61 of 125

For Discussion In This Session

  • Media Capture Issues
    • Issue 495/Issue 472: Video dimension constraints (Peter Thatcher)
    • Issue 470: Does getSettings() reflect configured or actual settings? (Jan-Ivar)
    • Issue 466: Question about setting belong to source in Section 3 (Jan-Ivar)
    • Issue 441: Interop for muted tracks (Jan-Ivar)
    • Issue 478: Content hints for MediaStreamTrack (Peter Boström)

61

62 of 125

Issue 495/Issue 472: Video dimension constraints (Peter Thatcher)

Scenario: Sender has a 16:9 track. Receiver wants to receive a 1:1 track.

Solution we don't want: something on RtpSender to change 16:9 into 1:1 when sending it.

Solution we do want: a way to get a 1:1 track from a 16:9 track.

// Or maybe height and width instead of aspectRatio�track.applyConstraints({aspectRatio: {exact: 1.0}})

Problem: does the app prefer adding pixels (pillar/letterbox) or removing pixels (crop)? �Related problem: is the browser allowed to scale to avoid overly adding or removing?

62

63 of 125

Issue 495/Issue 472: Video dimension constraints (Peter Thatcher)

Proposal: let the app tell you what it's happy with a new constraint.

Let's call it resizeMode.

enum ResizeModeEnum {� "crop-and-scale", // Removes pixels; allows scaling� "box-and-scale", // Adds pixels; allows scaling� "none", // No adding or removing; no scaling�};

track.applyConstraints({aspectRatio: {exact: 1.0}, � resizeMode: "crop-and-scale"})��Last question: what's the default? I prefer "crop-and-scale".

63

64 of 125

Issue 472: No constraint defaults. When do we downscale? (Jan-Ivar)

  • Problem: Web devs get vastly different results from browsers that don’t support downscaling.
  • New constraints aside, can we we converge on default behavior for downscaling in all browsers? SHOULD minimize fitness distance, or SHOULD minimize processing?�
  • await track.applyConstraints({width: 640, height: 360}); // does it downscale/crop?
  • await track.applyConstraints({width: {exact: 640}, height: {exact: 360}); // this?

Two models being explored today:

  • Chrome: downscales on both above
  • Firefox: downscales on neither today, may downscale soon only in second case.
  • How do you avoid downscaling/processed modes today?�({width: {min: 640, max: 1024}, height: {min: 360, max: 720}); // trust browser�({width: {min: 640, max: 1024, ideal: 1024}, height: {min: 360, max: 720, ideal: 720})

64

65 of 125

Issue 470: Does getSettings() reflect configured or actual settings? (Jan-Ivar)

  • Is it a settings arbitration API (between concurrent users) or a measurement API?
  • Spec says "To check which ConstraintSets are currently in effect, the application should use getSettings.", suggesting deterministic target “settings” values.
  • Live measured values sometimes deviate from their (target) “settings”, like during:
    • camera motor pan 30 → 60: actual < setting, actual > old {pan: {max: 30}}
    • System overload or low light: measured frameRate fluctuates below target.
    • Live volume vs volume setting.
  • If getSettings() were to return live values, then the spec text above doesn’t hold.
  • Does any browser implement actual values? (getSettings() in Firefox returns setting).
  • Does any browser implement aggressive OverconstrainedError or onoverconstrained? No, cause auto-disabling != useful, would surprise users at this point who might use exact to force rescaling/decimating. Rare users who want this behavior are better off JS measuring.
  • Must agree when promise resolves, or suffer users polling getSettings() waiting on motor.

65

66 of 125

Issue 466: Question about setting belong to source in Section 3 (Jan-Ivar)

  • (Note: Github discussion devolved into discussing previous slide and ideal)
  • @guido and I are on the same page on core question above:
    • Sources practically support more than one setting concurrently. True for audio filters.
    • track.getSettings() should return what’s relevant to consumers of that track.
    • Which means getSettings() from different tracks from the same source may return different values due to downscaling/decimating/audio processing.
    • Tracks are useful abstraction APIs for browsers. Actual hardware source settings seem of little relevance, and mandating their examination is a cross-origin security issue (can be used to detect concurrent use, e.g. is user using a particular site atm, or even be used to morse-code data across origins, bypassing cross-origin protections).
  • Suggestion: Massage language as needed to reflect this. If this means settings “belong” to tracks, so be it, but if there are other ways to refine it, swell.

66

67 of 125

Issue 470: Does getSettings() reflect configured or actual settings? (Jan-Ivar)

  • Is it a settings arbitration API (between concurrent users) or a measurement API?
  • Spec says "To check which ConstraintSets are currently in effect, the application should use getSettings.", suggesting deterministic target “settings” values.
  • Live measured values sometimes deviate from their (target) “settings”, like during:
    • camera motor pan 30 → 60: actual < setting, actual > old {pan: {max: 30}}
    • System overload or low light: measured frameRate fluctuates below target.
    • Live volume vs volume setting.
  • If getSettings() were to return live values, then the spec text above doesn’t hold.
  • Does any browser implement actual values? (getSettings() in Firefox returns setting).
  • Does any browser implement aggressive OverconstrainedError or onoverconstrained? No, cause auto-disabling != useful, would surprise users at this point who might use exact to force rescaling/decimating. Rare users who want this behavior are better off JS measuring.
  • Must agree when promise resolves, or suffer users polling getSettings() waiting on motor.

67

68 of 125

Issue 441: Interop for muted/track.enabled=false tracks (Jan-Ivar)

  • The remaining concern (interop) seems like a WebRTC issue, not mediacapture.
    • WebRTC could encode 1 fps while MediaRecorder sees 30 fps.
  • In WebRTC, there will be cases where the webrtc backend will stop receiving frames:
    • track being muted or track.enabled=false (hardware may be off),
    • manual canvas capture stream.
  • Concern is whether an implementation choice (in this case not sending redundant frames) might cause interop troubles if the infrastructure is not expecting that kind of scenario.
  • Spec:
    • 1 frame per second?
    • No frames at all?
    • audio/video?
  • Are frames on wire needed to keep connection alive? To keep ports open?

68

69 of 125

Issue 478: Content hints for MediaStreamTrack (Peter Boström)

  • Browsers configure implicit settings based on content source.�Chrome/WebRTC: UVC -> webcam, tab/desktop capture -> screenshare, all audio -> speech�Wrong for capture cards, wrong behavior when screensharing video / game content, wrong for music.
  • Use a content “hint” to help the browser make implicit decisions.�Using a MST property -> can be used by MediaStreamRecorder and other APIs outside WebRTC with less flexible controls, without having to modify their specifications (scales better). Informs “balanced”.
  • Example behavior:�Motion video: Downscale / use higher max QP to preserve motion.�Detail video: Drop frames / use lower max QPs to preserve individual frame quality.�Speech: Use noise suppression and echo cancellation by default. Maybe enhance intelligibility?�Music: Turn off noise suppression (preserve snares), tune echo cancellation differently / turn it off.

69

70 of 125

Issue 478: Content hints for MediaStreamTrack (Peter Boström)

  • October interim discussion:
    • Does this belong on MSTs or on sources and/or sinks?
    • Might need an ‘auto’ setting for any constraint that could be affected by this to deal with otherwise unpredictable defaults
    • How would this work with the already complex selectSettings() algorithm?
    • What, if any, is the impact of adding this into the gUM spec on extension specs that currently don't know anything about it?
    • How would conflicting settings of this value be addressed?
    • What are the testing implications?

70

71 of 125

Issue 1533: Live RTCRtpContributingSource confusing (Jan-Ivar)

  • No value in its liveness when one already has to poll to discover new participants.
  • When participants left, objects remained stuck with their last values.
  • To store the data, you’d need a copy algorithm, or data would plot a straight line.
  • Solution: s/interface/dictionary/

dictionary RTCRtpContributingSource {� DOMHighResTimeStamp timestamp;� unsigned long source;� byte? audioLevel;� };

dictionary RTCRtpSynchronizationSource : RTCRtpContributingSource {� boolean? voiceActivityFlag;� };

71

72 of 125

Splitting Priority Part 2

draft-ietf-rtcweb-transports-17 says "The priority settings affect two pieces of behavior: Packet send sequence decisions and packet markings. Each is described in its own section below". We can change that to say "there are two priority settings":

https://github.com/rtcweb-wg/rtcweb-transport/pull/50

Meanwhile, we can add this to RtpEncodingParameters. The existing priority sets both, except when overridden by either or both.

https://github.com/w3c/webrtc-pc/pull/1659

RTCPriorityType bitratePriority = "low";

RTCPriorityType markingPriority = "low";

72

73 of 125

Media Capture, WebRTC-PC and WebRTC-Stats Next Steps

W3C TPAC

November 7, 2017

Burlingame, CA

73

Presenters: Bernard, Harald, Varun

74 of 125

For Discussion Today

  • Media Capture next steps
  • WebRTC-PC next steps
  • WebRTC-stats next steps
  • Other specifications

74

75 of 125

Media Capture Next Steps

  • Recycled at CR
    • Complete test suite
    • Address outstanding issues
    • Recycle at CR again (to handle substantive issues)
  • Next goal: PR

75

76 of 125

WebRTC-PC Status

  • 96 open issues. Breakdown
    • 25 labelled “editorial”
    • 15 labelled “test suite issue”
    • 10 labelled “question”
    • 3 labelled “PR exists”
  • By topic:
    • 15 relating to peer identity
    • 9 relating to object model
    • 6 relating to ICE
    • 5 relating to data channel/SCTP

76

77 of 125

WebRTC-PC Next Steps

  • Immediate goals:
    • Complete test suite
    • Require tests for new PRs
    • Address outstanding issues
    • Recycle at CR
  • Ultimate goal: PR
    • Interoperability requirements
      • WPT to run in two browsers (dashboard)
      • KITE test requirements?

77

78 of 125

Other specifications

  • Wide review for:
    • Media recording
    • Image capture
    • From element
    • Screen capture?
    • Depth?

78

79 of 125

WebRTC-Stats Status

  • 30 open issues. Breakdown
    • 12 labelled “CR blocker”, 3 are bugs
    • 6 labelled “submitter input/list discussion needed”
    • 10 labelled “PR exists/ready”
    • 4 labelled “icebox”

79

80 of 125

WebRTC-Stats Next Steps

  • Immediate goals:
    • Wide review
    • Address CR-blocking issues
    • Get started on the test suite?
  • Candidate Recommendation
    • MTI stats documented in webrtc-pc
    • How to test, verify interoperability
  • Ultimate goal: PR
    • Interoperability requirements
      • Currently, browsers implement some parts of the getStats() Promise API

80

81 of 125

WebRTC-Stats Experimentation

  • We have running code, sometimes we want to measure things, how do we do that?

  • How to experiment with non-standard metrics?
    • Need to have a definition for the experimental metrics.
    • Return the data in the current objects?
    • How do we name these?
      • Prefix experiments with “exp” before the metric name.
  • How to document these, in a
      • separate section of webrtc-stats, or
      • separate doc

81

82 of 125

WebRTC New Work

W3C TPAC

November 7, 2017

Burlingame, CA

82

Presenters: Peter, Sergio

83 of 125

For Discussion Today

  • Potential new functionality
    • Scalable video coding (Sergio Garcia Murillo)
    • Full (fuller?) simulcast support
    • QUIC (Peter Thatcher)
    • Fine grain media stack control (not based on SDP)
    • Working methods

83

84 of 125

Objectives for this session

  1. What: What new things are potentially of interest?
  2. Working methods: When we want to add things, what do we do? Options:

  1. Add to existing docs
  2. Create new docs
  3. ???

84

85 of 125

Things definitely "post 1.0"

  • Fine grain media stack control (not based on SDP)
  • QUIC data channels
  • Controls on congestion control (such as a start BWE)
  • More flexible simulcast
  • Exposing encoders/decoders directly?
  • Plugging in parts with WebASM (encoders, encryption)

85

86 of 125

QUIC data channels

Idea: Send data with QUIC instead of SCTP + DTLS

  • Lots of app developers are asking for it
  • Easier to terminate than DTLS+SCTP (esp. on server)
  • Faster to setup (fewer round trips)
  • Easier to get real-time congestion control (BBR)
  • We can add back-pressure from the receive side�(better support for sending large files, etc)
  • New possibilities: HTTP from browser?

86

87 of 125

Proposal: add QUIC data channels to WebRTC

  • It's easy and simple!
  • Add a QuicTransport and a QuicStream independent of PC
    • Defined in ORTC CG already
    • Prototype in Chrome implemented
  • Maybe some minimal IETF work as well to along
    • a draft of multiplexing QUIC with other things
    • The QUIC WG has a lot of work to do, but we mostly just wait and benefit from what they define

87

88 of 125

Optional long-term work not proposed here

  • Standardize a mapping from DataChannel to QUIC streams
  • Define a way to offer/answer QUIC in SDP
  • Add QUIC to PeerConnection
  • It's more difficult and complex, but doable if desired

88

89 of 125

QuicTransport

Like DtlsTransport: does a crypto handshake based on local certificates and remote fingerprints.

Like SctpTransport: creates data channels/streams and has an event for when the remote side creates channels/streams

89

90 of 125

QuicTransport

[Constructor(IceTransport, sequence<Certificate>)]

interface QuicTransport {

readonly attribute QuicTransportState state;

QuicParameters getLocalParameters();

sequence<ArrayBuffer> getRemoteCertificates();

void start(QuicParameters remoteParameters);

void stop();

QuicStream createStream();

attribute EventHandler onstream;

attribute EventHandler onstatechange;

};

90

91 of 125

Example: setup

var ice = ...;

var certs = ...;

var quic = new QuicTransport(ice, certs);

var remoteParameters = signalExchange(quic.getLocalParameters())

quic.start(remoteParmeters);

quic.onstatechange = (evt) => {

if (evt.state == "connected") {

// :)

}

}

91

92 of 125

QuicStream

  • Maps very closely to a QUIC stream
    • A bidirectional stream of bytes, like a TCP stream
    • But you can have a lot of them
  • An RTCDataChannel can be built on top
  • Other things can be built on top
    • WHAT WG streams
    • HTTP server?
  • Backpressure from the receive-side is possible

92

93 of 125

QuicStream

interface QuicStream {

readonly attribute QuicStreamState state;

readonly attribute unsigned long readBufferedAmount;

readonly attribute unsigned long writeBufferedAmount;

setTargetReadBufferedAmount(unsigned long amount);

unsigned long readInto(Uint8Array data);

void write(Uint8Array data);

void finish();

void reset();

void attribute EventHandler onstatechange;

Promise waitForReadable(amount); // like waitForReadBufferedAmountBelow

Promise waitForWritable(amount, ...); // like waitForWriteBufferedAmountBelow

}

93

94 of 125

Example: small, unordered, unreliable

// Send side for each message

var qstream = quic.createStream();

qstream.write(data);

qstream.finish();

// Could be replaced with a max time or max rtx policy

setTimeout(() => qstream.reset(), 5000);

// Receive side for each message

quic.onstream = (qstream) => {

qstream.readInto(buffer);

};

94

95 of 125

Example: big, reliable, ordered

let qstream = quic.createStream();

for chunk in chunks {

await qstream.waitForWritable(chunk.byteLength, targetBuffer); // back pressure

qstream.write(chunk);

}

qstream.finish();

quic.onstream = qstream => {

await qstream.waitForReadable();

while (qstream.state == "open") {

qstream.readInto(buffer); // back pressure

await qstream.waitForReadable();

}

}

95

96 of 125

Example:ordered data channels

  • One QuicStream
  • Framing in the stream to separate messages
  • OPEN message is the first message

Could be defined in IETF, but doesn't need to be. Can be implemented in JS.

96

97 of 125

Example:unordered channels

  • One QuicStream per message
  • Data Channel ID at front of stream
  • OPEN message is separate message

Could be defined in IETF, but doesn't need to be. Can be implemented in JS.

97

98 of 125

Roadblocks

  • QUIC transport protocol stabilization
  • Demuxing with RTP/RTCP, DTLS, and ICE
  • QuicTransport needs an IceTransport, preferably without a PeerConnection

98

99 of 125

QUIC transport protocol stabilization

Still stabilizing in regards to:

  • Unidirectional vs. bidirectional vs. both
  • QUIC stream states (reset vs. finish)

99

100 of 125

Demuxing with RTP/RTCP, DTLS, and ICE

Good news: it probably can be done with no change to QUIC:

draft-aboba-avtcore-quic-multiplexing-01

But it could be cleaner with changes to QUIC or an extra byte of framing. Read the draft if you're interested.

100

101 of 125

IceTransport

A QuicTransport needs an IceTransport. Where does it get it?

The easiest thing to do is to allow constructing an IceTransport without a PeerConnection.

With something like the next slide.

101

102 of 125

IceTransport

partial interface IceTransport {

void start(IceGatherer, IceParameters remote, IceRole);

void stop();

void addRemoteCandidate(IceCandidate);

}

�interface RTCIceGatherer {

IceParameters getLocalParameters();

void gather(optional RTCIceGatherOptions);

void close();

attribute EventHandler onlocalcandidate;

}

102

103 of 125

IceTransport example

var gatherer = new IceGatherer();

gatherer.gather();

signalLocalIceParameters(gatherer.getLocalParameters());

gatherer.onlocalcandidate = signalLocalIceCandidate;

var ice = new IceTransport();

onSignaledRemoteIceParameters = (remoteParameters) => {

ice.start(gatherer, remoteParameters, role);

};

onSignaledRemoteIceCandidate = (remoteCandidate) => {

ice.addRemoteCandidate(remoteCandidate);

}

103

104 of 125

Summary of Proposal

Add QuicTransport

Add QuicStream

Add IceTransport constructor/methods

Add IceGatherer

Great! Now we'll have p2p QUIC data streams in WebRTC.

Question: Should this be added to the CR, or in a separate doc? (or hybrid: ICE in CR; QUIC in separate doc)?

104

105 of 125

Fine grain media stack control (not SDP)

Goals:

  • interop with PeerConnection
  • no SDP/RtpTransceiver
  • Can construct and configure
    • IceTransport
    • DtlsTransport
    • RtpSender
    • RtpReceiver
    • SctpTransport
    • DataChannel
  • possible to add new transport protocols

105

106 of 125

One last attempt at content hint

Use case

Has a capture card�sets "detailed"

Has a game screencapture�sets "motion"

Has a stream music app�sets "music"

Effect on PC (especially w/ balanced):�Gets same behavior as screencast: �high resolution/quality; fps degrades; denoising off; maybe special code mode

Gets same behavior as camera: �high fps; resolution/quality degrades; denoising off

Gets intelligibility enhancement off (and other non-standard implicit speech processing); noise suppression; special codec mode; higher bitrate;

106

107 of 125

One last attempt at content hint

Use case

Has a capture card�sets "detailed"

Has a game screencapture�sets "motion"

Has a music app sets "music"

Effect on MediaRecorder�Gets same implicit encoding behavior as tab / screen capture (can’t be overridden otherwise).

�Gets same implicit encoding preferences as UVC (can’t be overridden otherwise).

�More bits allocated to the audio stream (w/o audioBitsPerSecond set). Default codec set as appropriate for music if not provided (user doesn’t need to know what Opus is or good music target bitrate for specific codecs).

107

108 of 125

Wrap-up and Action Items

W3C TPAC

November 7, 2017

Burlingame, CA

108

Presenters: Bernard, Stefan, Harald

109 of 125

Wrap-up items

  • Jan-Ivar: MediaCapture and Streams additional
  • Peter: an even scarier proposal
  • Cullen: scary ICE
  • Dom: Whither NV?
  • Peter: content hints redux

110 of 125

Issue 434 / PR 440 allowUserMedia

Mediacapture-main still references allowUserMedia:

<iframe allowUserMedia=true sandbox="allow-scripts" src="/foo">

Chrome 64 implements* different syntax for iframes as part of Feature Policy:

<iframe allow="camera" allow="microphone" sandbox="allow-scripts" src="/foo">

Firefox and Safari are looking to do the same

*) Chrome warns: “VideoCapture permission has been blocked because of a Feature Policy applied to the current document. See https://goo.gl/EuHzyv for more details.”

111 of 125

Action Items

* SVC + Simulcast few features: Not considering new features for WebRTC 1.0 (could be considered as a separate document)

* QUIC: QUIC Transport document, ICE transport extension and consider an ICE constructor in WebRTC

* Preference for Scary A over Scary B

* Project snowflake: put together an IETF document on a subset of ICE, W3C API document to access the subset.

112 of 125

More scary proposal: audio/video over QUIC

Two options:

Option A: low-level access to encoders/decoders

Option B: higher-level access to send/receive

112

113 of 125

Option A: low-level access to encoders/decoders

interface VideoEncoder {

Promise<EncodedVideoFrame> encodeVideoFrame(track, VideoEncodeParameters);

}

interface VideoDecoder { // Also a jitter buffer

void decodeVideoFrame(EncodedVideoFrame frame);

readonly attribute MediaStreamTrack decodedVideo;

}

113

114 of 125

Option A: low-level access to encoders/decoders

// To send a video frame

var encoded_frame = await encoder.encodeVideoFrame(track, {bitrate: ...});

var serialized_frame = serialize_frame(encoded_frame);

var qstream = quicTransport.createQuicStream();

qstream.write(serialized_frame); qstream.finish();

// To receive a video frame

var track = new MediaStreamTrack("video");

var buffer = ...; // Anyone remember how to make a buffer?

quicTransport.onstream = (qstream) => {

qstream.readInto(buffer);

var encoded_frame = deserialize_frame(buffer);

decoder.decodeVideoFrame(encoded_frame, track);

}

render_track(track);

114

115 of 125

Option A: low-level access to encoders/decoders

dictionary VideoEncodeParameters {

unsigned long bitrate;

boolean generateKeyFrame;

// TODO: resolutionScale, framerateScale, ...

}

dictionary EncodedVideoFrame {

unsigned long id;

unsigned short width;

unsigned short height;

unsigned short rotation;

unsigned long capturedTimestampMs;

ByteArray encodedData;

// TODO: SVC, vp8, vp9, h264, and h265-specific parameters, ...

}

115

116 of 125

Option A: low-level access to encoders/decoders

interface AudioEncoder {

Promise<EncodedAudioFrame> encodeAudioFrame(track, AudioEncodeParameters);

}

interface AudioDecoder { // Also a jitter buffer

void decodeAudioFrame(EncodedAudioFrame);

readonly attribute MediaStreamTrack decodedAudio;

}

116

117 of 125

Option A: low-level access to encoders/decoders

// Send an audio frame

var encoded_frame = encoder.encodeAudioFrame(track, {ptime: 20});

var serialized_samples = serialize_samples(encoded_frame);

var qstream = quicTransport.createStream();

qstream.write(encoded_samples); qstream.finish();

// Receive an audio frame

var track = new MediaStreamTrack("audio");

quic.onstream = function(qstream) {

var buffer = ...; // Anyone remember how?

serialized_frame = qstream.readInto(buffer);

encoded_frame = deserialize_frame(serialize_frame);

decoder.decodeAudioFrame(encoded_samples, track);

}

playout_track(track);

117

118 of 125

Option A: low-level access to encoders/decoders

dictionary AudioEncodeParameters {

unsigned long frameSize; // aka ptime, in ms

unsigned long bitrate;

}

dictionary EncodedAudioSamples {

// Effectively a start and end time stamp, but in terms of a "sample rate clock"

unsigned long startSampleIndex;

// Theoretical endSampleIndex == startSampleIndex + sampleCount

unsigned int sampleCount;

ByteArray encodedData;

// TODO: opus-specific parameters?

}

118

119 of 125

Option B: high-level access to send/receive

interface VideoSender {

void setTransport(QuicTransport);

void setTrack(MediaStreamTrack);

void sendVideo(VideoSendParameters);

}

dictionary VideoSendParameters {

DOMString muxId;

DOMString codecId; // Obtained from capabilities

unsigned long maxBitrate;

RTCDegradationPreference degradationPreference = "balanced";

// TODO: fec, resolutionScale, framerateScale

}

119

120 of 125

Option B: high-level access to send/receive

interface VideoReceiver {

readonly attribute MediaStreamTrack track;

void setTransport(QuicTransport);

Promise receiveVideo(); // Resolves when the remote side sends a stream

}

120

121 of 125

Scary ICE

Api to:

  • Gather candidates (filtered like today)
  • Send STUN requests (restricted like today)
  • Notify of STUN requests

Advantages:

  • Not bilateral
  • Testable
  • Very little new code

121

122 of 125

One last attempt at content hint

Use case

Has a capture card�sets "detailed"

Has a game screencapture�sets "motion"

Has a stream music app�sets "music"

Effect on PC (especially w/ balanced):�Gets same behavior as screencast: �high resolution/quality; fps degrades; denoising off; maybe special code mode

Gets same behavior as camera: �high fps; resolution/quality degrades; denoising off

Gets intelligibility enhancement off (and other non-standard implicit speech processing); noise suppression; special codec mode; higher bitrate;

122

123 of 125

One last attempt at content hint

Use case

Has a capture card�sets "detailed"

Has a game screencapture�sets "motion"

Has a music app sets "music"

Effect on MediaRecorder�Gets same implicit encoding behavior as tab / screen capture (can’t be overridden otherwise).

�Gets same implicit encoding preferences as UVC (can’t be overridden otherwise).

�More bits allocated to the audio stream (w/o audioBitsPerSecond set). Default codec set as appropriate for music if not provided (user doesn’t need to know what Opus is or good music target bitrate for specific codecs).

123

124 of 125

For extra credit

124

Name that bird!

125 of 125

Thank you

Special thanks to:

W3C/MIT for WebEx

WG Participants, Editors & Chairs

The bird

125