fix(ssrc-rewriting): Fire track removed/added instead of owner changed.
When an existing SSRC for a remote track gets re-mapped from one source to another, fire a TRACK_REMOVED event followed by TRACK_ADDED event instead of TRACK_OWNER_CHANGED event. This should simplify the application logic for track handling.
fix(SDP): Negotiate only baseline H.264 codecs for p2p.
Chrome on macOS recently started offering encoder for higher level (5.2) but decoder only for level 3.1. See https://issues.chromium.org/issues/324930413
Therefore, filter out all H.264 payload types with main and high profiles. Also, sort all H.264 payload types so that same pt is picked for both H.264 encoder and decoder. Fixes random black tile issues across different browsers when H.264 is the preferred codec for p2p.
fix(TPC): Run the DD ext header check on all browsers.
We do not want non Chromium browsers to negotiate DD ext headers when VP8/VP9 is the selected codec. Fixes poor video quality issue for Safari when Av1 is offered by Jicofo.
Set the scalabilityMode to undefined for VP8 after a VP9->VP8 switch even though the browser returns L1T2 in the RTCRtpSender.getParameters() call. Fixes an issue where the bridge stops forwarding video for some participants after vp8->vp9 switch.
If MediaStreamTrack.getSettings() doesn't return the height of the track, use the constraints passed to gUM for calculating the height. Fixes an issue for Firefox/Linux which could result in media not displayed.
fix(video-quality): Adjust encodings bitrates/scalefactor for high capture resolutions (#2436)
* fix(video-quality): Adjust encodings bitrates/scalefactor for high capture resolutions.
When the client is configured to capture camera sources at 1080p or higher, adjust the bitrates and the encodings scale factor accordingly.
* squash: Address review comments
Fix the bitrates set on the remote description and also bump up the bitrates for 1080p, 4k and screenshare.
* squash: Address some more review comments.
fix(video-quality): Remove the encoding check for webkit.
This check is not needed anymore since we now set the correct scaleResolutionDownBy value everytime the encodings are configured. Fixes a regression on Safari where it can end up sending low resolution to a p2p peer in some cases. Also, add more unit tests for p2p desktop share cases.
* fix(RTC): Remove support for plan-b SDP.
Since unified plan mode becomes the default mode, so does multi-stream mode.
* squash: Remove plan-b unit tests and fix comments
* squash: address review comments
fix(TPC): Do not configure 'scaleResolutionDownBy' and 'maxBitrate' for legacy VP9 K-SVC.
When these are configured, the browser sends only the lowest resolution layer even when all the encodings are active. Fixes a quality issue on older versions of Chromium that do not support the scalabilityMode API.
There is a lot of additional noise when log level is set to debug, the SDP descriptions should be set to trace (As it seems it was originally intended, based on the name of the variable)
Add SVC and Simulcast support for AV1 and VP9. (#2350)
Add SVC and Simulcast support for AV1 and VP9.
The default mode is the full SVC mode for VP9. It works as expected with the current version of JVB.
AV1 in the client is only supported when the bridge negotiates the Dependency Descriptor extension headers which are needed for reading the layer information for AV1 and H.264 video frames.
* feat: Enable H.264 simulcast support.
Multi-encoding simulcast for H.264 is supported now because of the DD header ext support added on the bridge side.
* fix(video-quality): Add default bitrates for all codecs.
Expect the videoQuality settings in the new format, deprecated configs are still supported.
videoQuality: {
AV1: {
maxBitratesVideo: {
low: 100000,
standard: 300000,
high: 1000000,
ssHigh: 1500000
},
useScalabilityModeAPI: {
enabled: true,
useSimulcast: true, //(defaults to SVC),
useKSVC: true //(defaults to L3T3_KEY)
},
},
H264: {
maxBitratesVideo: {
low: 200000,
standard: 500000,
high: 1500000,
ssHigh: 2500000
}
},
VP8: {
maxBitratesVideo: {
low: 200000,
standard: 500000,
high: 1500000,
ssHigh: 2500000
}
},
VP9: {
maxBitratesVideo: {
low: 100000,
standard: 300000,
high: 1200000,
ssHigh: 2500000
},
useScalabilityModeAPI: {
enabled: true,
useSimulcast: true, //(defaults to SVC),
useKSVC: true //(defaults to L3T3_KEY)
},
}
}
* Disable encodings when requested height for screenshare is 0.
* feat: add unit tests for scalability modes.
* ref: Move all encoding configuration calculation to TPCUtils.
* Add more unit tests for VP9 K-SVC mode.
* Make codec name in settings case insensitive.
Also read the deprecated max bitrates correctly, add unit tests to test it.
* ref(TPC): isSimulcastOn -> isSpatialScalabilityOn.
It makes more sense to call it spatial scalability than simulcast now that full SVC support is available.
* fix: Negotiate AV1 DD header exts only for AV1 and H.264.
* fix: Rename setting useL3T3Mode->useKSVC and adjust the defaults.
fix(codec-selection) Pick only 1 VP9 codec for p2p negotiation.
More than one VP9 payload type is produced in the offer, more experimental ones if the local endpoint has no local video source. Munge the SDP to remove all codecs besides the one with profile-id=0 so that only one VP9 codec is negotiated with p2p peer.
fix(JingleSession) Modify encoding to stop/start outgoing media on p2p.
This is much faster than changing direction on the transceiver and doesn't need a renegotiation for the suspending/resuming media. Also fixes an issue with audio-only mode in p2p where media doesn't resume when audio-only mode is disabled if it was enabled while the jvb connection was active.
ref(JingleSession) Always call sRD->cA-sLD for renegotiation.
For renegotiations triggered by the application, it is ok to execute sRD->cA-sLD cycle on the p2p initiator instead of executing cO->sLD->sRD cycle. Chrome sometimes creates a third m-line for p2p when createOffer is called which is unexpected and therefore it breaks the client's renegotiation cycle. This has been done in other places already, i.e., when remote sources are signaled, etc. so making it uniform across all renegotiations.
Revert "Adjusted wrapping method to have RTCRtpSender setting parameters in sequential manner in order to solve race condition when transaction id can be reset at the end of videoSender setParameters and cause exception if another update was already in fly and before its check for transaction id presence."
This reverts commit 17ade96a70.
It causes setParameters failures which can cause media being leaved to
JVB when in a P2P connection.
* fix(codec-selection) Use a configurable preferred codecs list to select the codecs.
Allow asymmetric codecs to be configured on the endpoints. This means that Firefox and Safari which have bugs with VP9 encode will now encode VP8 but decode VP9 coming in from Chromium endpoints.
* fix(codec-selection) Add unit tests for the codec selection logic.
* feat(codec-selection): Introduce mobileCodecPreferenceOrder setting in config.js.
* fix(codec-selection) Avoid unnecessary renegotiations.
On participant join/leave, check if the new intersection of codecs are already configured to be the top n codecs.
* Address review comments
* fix: Strip the codecs that are not in the codec list from the video m-lines.
Also, ignore remote codecs published in presence for p2p connections.
* fix: Define default codec order for mobile and desktop.
Fix an issue where p2p between mobile and desktop was broken.
* fix: Add default codecs for both p2p and jvb on mobile devices.
Munge the initial offer sent out by RN clients since RN doesn't support RTCRtpTransceiver#setCodecPreferences.
Adjusted wrapping method to have RTCRtpSender setting parameters in sequential manner in order to solve race condition when transaction id can be reset at the end of videoSender setParameters and cause exception if another update was already in fly and before its check for transaction id presence.
fix(ssrc-rewriting) Update owners when a new SSRC is assigned to existing source.
Fixes a bug where the remote video freezes if the remote user does an ICE restart using session-terminate. In this case, a new SSRC is assigned to the remote source which will have the same source-name.
fix(stats) Obtain resolution/fps from 'outbound-rtp' stats. (#2265)
* fix(stats) Obtain resolution/fps from 'outbound-rtp' stats.
'Track' based stats were dropped in Chrome 112, therefore send resolution and fps for the simulcast case needs to be calculated based on the 'outbound-rtp' streams that are currently active.
* squash: remove an unwanted log
* Squash: Address review comments.
Use outbound-rtp stats for both Firefox and Safari.
Firefox - Ignore active field if not present in the stats and calc fps using 'framesSent'.
fix(TPC) Avoid applying constraints on desktop tracks if not needed. (#2246)
* fix(TPC) Avoid applying constraints on desktop tracks if not needed.
Ignore sender constraints if the client is already sending video of the requested resolution. For desktop tracks, max resolution will be the height of the window being captured irrespective of the height being requested by the peer. Therfore, check if the configured resolution is equal to the track height for all requested heights > 0.
Fixes an issue where the track addition fails because of setParameters failing on the video track. This is only seen the torture tests because this is very timing specific.
* squash: check correct scaleResolutionDownBy value for p2p conn.
fix(codec-selection) Apply codec preferences to initial offer/answer.
This fixes an issue where p2p clients (with different codec preferences) fail to decode video because the negotiated codecs are removed from the supported codecs list after the media session is established. The codec preferences will be applied when the first offer/answer is created.
fix(codec-selection) Check if disabled is already removed from sdp.
This should avoid unnecessary renegotiations if disabledCodec setting is present in config.js and should improve time to receive media when joining big calls.