Hi,
Following the
intent-to-ship I'm happy to announce that spec-compliant Simulcast will be coming to chrome in M74 (assuming all approvals and due process).
Backwards Compatibility
If you are already achieving simulcast by using the legacy SDP munging technique, then rest assured, you do not have to make any changes and your scenario will not break.
You are highly encouraged to change your code to use the new API surface. <meme>Munging the SDP? Just say "no!"</meme>
Summary
Users can now call
addTransceiver on the peer connection and specify multiple
send encodings to configure the platform to send multiple encoding layers of the same video source.
pc.addTransceiver('video', {
sendEncodings: [ { "rid": "f" },
{ "rid": "h", "scaleResolutionDownBy": 2 },
{ "rid": "q", "scaleResolutionDownBy": 4 }]
});
During negotiation, this will generate the appropriate SDP lines to signal simulcast:
a=rid:f send
a=rid:h send
a=rid:q send
a=simulcast:send f;h;q
and the configuration for layers (not their number or RIDs) can change using
setParameters().
Details
Simulcast must be negotiated by both parties. If the answer SDP does not contain the symmetric a=simulcast:recv line, then simulcast will not be sent. Instead the platform will fall back to only sending the first layer.
Layers can be rejected in the answer through omission. Omitted layers will not be sent and are removed from the sender's parameters.
A client indicating multiple send encoding layers without specifying RID values, will get RIDs that are generated by the platform.
Layers can be paused by setting the
active attribute to false. This is different than layers being rejected because paused layers can be re-enabled in future calls to setParameters()
The Fine Print
PeerConnection does not support receiving simulcast. A server (Selective Forwarding Unit) must be used between PeerConnections.
Simulcast scenario is relevant for group calls where an SFU should be used, so no support is available for trying to negotiate simulcast between two peers without an SFU.
SSRCs will not be signaled in this scenario.
RIDs are the identifiers that are used in simulcast and providing another source of identifiers without spec-compliant grammar to indicate how the two identifiers correlate introduces issues of conflicting ids.
SSRCs are used in all other unified plan scenarios for backwards compatibility until MID routing is more prevalent, however, since simulcast requires the SFU to signal RIDs, it is reasonable to assume that signaling RIDs indicates support for them.
An important difference between simulcast and the SDP munging technique is the negotiation aspect. The munging scenario does not consult the other party if simulcast should be sent and there is not way to reject it.
The new API requires that simulcast be 'accepted' during negotiation and multiple layers will not be sent if they are not acknowledged by the receiving party.
Looking forward to seeing this used in the wild and hearing community feedback,
Amit