Failed to execute 'addTransceiver' on 'RTCPeerConnection'

Hello,

Is there anyone having this issue with the latest updates of Chrome [109.0.5414.87 (Official Build) (x86_64)] and Safari [16.1 (18614.2.9.1.12)] when try to produce video.

Produce error: DOMException: Failed to execute 'addTransceiver' on 'RTCPeerConnection': Attempted to set RtpParameters scalabilityMode to an unsupported value for the current codecs.

With FireFox, Opera, Edge, Brave seems all ok.

mediasoup: 3.11.4
mediasoup-client: 3.6.70

Thank you!

Changing scalabilityMode: from ‘S1T3’ ----> ‘S3T3’ seems fix it.

Are you reproducing the issue in the mediasoup-demo? If not, which parameters are you passing to sendTransport.produce()? And which codecs have you enabled in the mediasoup Router?

Hi ibc,

Are you reproducing the issue in the mediasoup-demo?

No, in the mediasoup-demo seems ok.

which parameters are you passing to sendTransport.produce()?

// Producer init transport

            const data = await this.socket.request('createWebRtcTransport', {
                forceTcp: false,
                rtpCapabilities: device.rtpCapabilities,
            });

            if (data.error) {
                return console.error('Create WebRtc Transport for Producer err: ', data.error);
            }

            this.producerTransport = device.createSendTransport(data);
...


// Router transport

        const { maxIncomingBitrate, initialAvailableOutgoingBitrate, listenIps } = config.mediasoup.webRtcTransport;

        const transport = await this.router.createWebRtcTransport({
            listenIps: listenIps,
            enableUdp: true,
            enableTcp: true,
            preferUdp: true,
            initialAvailableOutgoingBitrate,
        });

And which codecs have you enabled in the mediasoup Router?

        // Router settings
        router: {
            mediaCodecs: [
                {
                    kind: 'audio',
                    mimeType: 'audio/opus',
                    clockRate: 48000,
                    channels: 2,
                },
                {
                    kind: 'video',
                    mimeType: 'video/VP8',
                    clockRate: 90000,
                    parameters: {
                        'x-google-start-bitrate': 1000,
                    },
                },
                {
                    kind: 'video',
                    mimeType: 'video/VP9',
                    clockRate: 90000,
                    parameters: {
                        'profile-id': 2,
                        'x-google-start-bitrate': 1000,
                    },
                },
                {
                    kind: 'video',
                    mimeType: 'video/h264',
                    clockRate: 90000,
                    parameters: {
                        'packetization-mode': 1,
                        'profile-level-id': '4d0032',
                        'level-asymmetry-allowed': 1,
                        'x-google-start-bitrate': 1000,
                    },
                },
                {
                    kind: 'video',
                    mimeType: 'video/h264',
                    clockRate: 90000,
                    parameters: {
                        'packetization-mode': 1,
                        'profile-level-id': '42e01f',
                        'level-asymmetry-allowed': 1,
                        'x-google-start-bitrate': 1000,
                    },
                },
            ],
        },
...

Thank you!

Actually this question is not answered in your response.

Ops, sorry

            const params = {
                track,
                appData: {
                    mediaType: type,
                },
            };

            if (!audio && !screen) {
                params.encodings = this.getEncoding();
                params.codecOptions = {
                    videoGoogleStartBitrate: 1000,
                };
            }

            console.log('sendTransport.produce() params: ', params);

            producer = await this.producerTransport.produce(params);

            console.log('PRODUCER', producer);

...
    getEncoding() {
        return [
            {
                rid: 'r0',
                maxBitrate: 100000,
                scalabilityMode: 'S3T3',
            },
            {
                rid: 'r1',
                maxBitrate: 300000,
                scalabilityMode: 'S3T3',
            },
            {
                rid: 'r2',
                maxBitrate: 900000,
                scalabilityMode: 'S3T3',
            },
        ];
    }

Actually this error seems present on mediasoup-demo too now.

Seems solved with also scalabilityMode: L1T3 ref: Use L1T3 · versatica/mediasoup-demo@b9f3f28 · GitHub

Could you explain me this solution? I had the same issue and I don’t understand why we need this codec change.

Do update to 3.6.80, as chrome 111 have changed something as mentioned here: