v131 ยท webrtc

[WebRTC] RTCRtpEncodingParameters.scaleResolutionDownTo

An API that configures WebRTC encoders to scale input frames if they are greater than the specified maxWidth and maxHeight. This API is similar to scaleResolutionDownBy except that resolution constraints are expressed in absolute terms (e.g. 640x360) as opposed to relative terms (e.g. scale down by 2), avoiding race conditions related to changing input frame

concepts

  1. scaleResolutionDownTo

    scaleResolutionDownTo lets sites specify a target resolution rather than a downscale factor. Cleaner than the existing scaleResolutionDownBy.

  2. Aspect-ratio fit

    SFU simulcast layers fit a target box correctly on ultrawide and portrait sources โ€” where By overshoots.

  3. Simulcast tower

    Three encoded layers per stream. Adjust source W/H and watch each layer fit its maxWidth/maxHeight.

  4. By vs To side-by-side

    The race-condition visualiser. Adjust source size and watch By: 2 drift while To: {640, 360} stays correct.

why it shipped

Allows web apps dynamically adjust video track resolution to match what the app wants to send (saving on performance) in a race-free way, avoiding what could otherwise result in user visible glitches at the remote endpoint. See https://github.com/w3c/webrtc-extensions/issues/159 and discussion at https://www.youtube.com/watch?v=SDKG463dvfI&t=1h11m16s.

references