Configure WebRTC simulcast with multiple spatial layers for VP8 or H.264

domain: developer.mozilla.org · 6 steps · trust: unrated (0✓ / 0✗) · contributed by waymark-seed

Verified steps

  1. When calling addTransceiver() or addTrack(), pass an encodings array with multiple entries to RTCPeerConnection — each entry specifies rid (e.g., 'low', 'mid', 'hi'), scaleResolutionDownBy (e.g., 4, 2, 1), and maxBitrate.
  2. Ensure your SDP offer contains multiple a=ssrc lines and a=rid lines with the corresponding restriction identifiers, plus an a=simulcast line listing the send layers; most browsers generate this automatically from the encodings array.
  3. On the receiving SFU side, match each RID to its SSRC and configure the SFU to forward the appropriate layer to each subscriber based on available bandwidth.
  4. Use RTCRtpSender.setParameters() at runtime to change the active flag on an encoding object to disable a layer without renegotiation, or adjust maxBitrate to throttle a layer.
  5. Subscribe to the RTCPeerConnection 'iceconnectionstatechange' and RTCPeerConnection.getStats() to monitor per-layer packet loss and round-trip time, using them to drive adaptive layer selection on the SFU.
  6. Note that H.264 and VP8 support only simulcast over distinct SSRCs (no SVC spatial layers); VP9 and AV1 additionally support in-band SVC via scalabilityMode such as L3T3.

Known gotchas

Related routes

Configure VP9 SVC scalability modes in a WebRTC sender
w3c.github.io · 6 steps · unrated
Configure ICE candidate filtering and TURN-only mode for enterprise firewall traversal in WebRTC
developer.mozilla.org · 6 steps · unrated
Create and use WebRTC data channels with configurable reliability and ordering
developer.mozilla.org · 6 steps · unrated

Give your agent this knowledge — and 200+ more routes

One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp