diff --git a/Frontend/library/src/VideoPlayer/StreamController.ts b/Frontend/library/src/VideoPlayer/StreamController.ts index 879ab1a2..d7cad1a4 100644 --- a/Frontend/library/src/VideoPlayer/StreamController.ts +++ b/Frontend/library/src/VideoPlayer/StreamController.ts @@ -31,6 +31,12 @@ export class StreamController { 'handleOnTrack ' + JSON.stringify(rtcTrackEvent.streams), 6 ); + // Do not add the track if the ID is `probator` as this is special track created by mediasoup for bitrate probing. + // Refer to https://github.com/EpicGamesExt/PixelStreamingInfrastructure/pull/86 for more details. + if (rtcTrackEvent.track.id == 'probator') { + return; + } + const videoElement = this.videoElementProvider.getVideoElement(); if (rtcTrackEvent.track) { diff --git a/SFU/mediasoup-sdp-bridge/lib/index.js b/SFU/mediasoup-sdp-bridge/lib/index.js index 2725e69c..f4a0baff 100644 --- a/SFU/mediasoup-sdp-bridge/lib/index.js +++ b/SFU/mediasoup-sdp-bridge/lib/index.js @@ -138,10 +138,14 @@ class SdpEndpoint { }); const sendMsid = uuid_1.v4().substr(0, 8); console.log("[SdpEndpoint.createOffer] Make 'sendonly' SDP Offer"); + var videoRtpParameters; for (let i = 0; i < this.consumers.length; i++) { const mid = (_a = this.consumers[i].rtpParameters.mid) !== null && _a !== void 0 ? _a : "nomid"; const kind = this.consumers[i].kind; const sendParams = this.consumers[i].rtpParameters; + if (kind === 'video') { + videoRtpParameters = JSON.parse(JSON.stringify(sendParams)) + } sdpBuilder.receive({ mid, kind, @@ -150,6 +154,23 @@ class SdpEndpoint { trackId: `${sendMsid}-${kind}`, }); } + if (videoRtpParameters) { + videoRtpParameters.codecs[0].payloadType = 127; + const rtpParameters = { + mid: 'probator', + codecs: [videoRtpParameters.codecs[0]], + headerExtensions: videoRtpParameters.headerExtensions, + encodings: [{ ssrc: 1234 }], + rtcp: { cname: 'probator' }, + }; + sdpBuilder.receive({ + mid: 'probator', + kind: 'video', + offerRtpParameters: rtpParameters, + streamId: 'probator', + trackId: 'probator', + }); + } if (this.consumeData) { sdpBuilder.receiveSctpAssociation(); }