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.
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.
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.
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.
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.
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
Safari has limited simulcast support; test across browsers and be prepared for the SFU to receive only one layer from Safari senders.
Setting scaleResolutionDownBy to 1 for all layers (instead of progressively larger values) produces layers at the same resolution with only bitrate differences — verify your SFU treats them correctly.
Some SFUs require the SDP to be munged to add a=simulcast and a=rid before setting the local description; check your SFU SDK documentation before manually modifying SDP.
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