Skip to content

Failed to set remote video description send parameters #32

Open
@Igrium

Description

@Igrium

I'm trying to get node-webrtc to communicate with Unreal Engine, but when I call setRemoteDescription, It's crashing with:

[DOMException [InvalidAccessError]: Failed to set remote offer sdp: Failed to set remote video description send parameters for m-section with mid='0'.]

The SDP it's received is as follows:

v=0
o=- 2972928273947422983 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1 2
a=extmap-allow-mixed
a=msid-semantic: WMS pixelstreaming_audio_stream_id pixelstreaming_video_stream_id
m=video 9 UDP/TLS/RTP/SAVPF 127 97 98 99 100 101 102
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:bNw+
a=ice-pwd:Ig0eXmDSregiA/vvnhMgoU4s
a=ice-options:trickle
a=fingerprint:sha-256 45:16:B6:6D:F2:3E:FB:D0:09:41:03:91:24:74:DD:D8:4D:55:88:5B:46:83:35:82:B9:99:3E:1F:CA:7A:58:84
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 urn:3gpp:video-orientation
a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:pixelstreaming_video_stream_id video
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:127 H264/90000
a=rtcp-fb:127 goog-remb
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli
a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=127
a=rtpmap:98 H264/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=fmtp:98 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 red/90000
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:102 ulpfec/90000
a=ssrc-group:FID 2079964708 2769205221
a=ssrc:2079964708 cname:R5IjzVnJa4ND6xzi
a=ssrc:2079964708 msid:pixelstreaming_video_stream_id video
a=ssrc:2769205221 cname:R5IjzVnJa4ND6xzi
a=ssrc:2769205221 msid:pixelstreaming_video_stream_id video
m=audio 9 UDP/TLS/RTP/SAVPF 96 110
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:bNw+
a=ice-pwd:Ig0eXmDSregiA/vvnhMgoU4s
a=ice-options:trickle
a=fingerprint:sha-256 45:16:B6:6D:F2:3E:FB:D0:09:41:03:91:24:74:DD:D8:4D:55:88:5B:46:83:35:82:B9:99:3E:1F:CA:7A:58:84
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
a=sendrecv
a=msid:pixelstreaming_audio_stream_id audio
a=rtcp-mux
a=rtpmap:96 OPUS/48000/2
a=rtcp-fb:96 transport-cc
a=rtpmap:110 telephone-event/48000
a=ssrc:1708106480 cname:R5IjzVnJa4ND6xzi
a=ssrc:1708106480 msid:pixelstreaming_audio_stream_id audio
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=ice-ufrag:bNw+
a=ice-pwd:Ig0eXmDSregiA/vvnhMgoU4s
a=ice-options:trickle
a=fingerprint:sha-256 45:16:B6:6D:F2:3E:FB:D0:09:41:03:91:24:74:DD:D8:4D:55:88:5B:46:83:35:82:B9:99:3E:1F:CA:7A:58:84
a=setup:actpass
a=mid:2
a=sctp-port:5000
a=max-message-size:262144

I'm not really sure what to do about this, as it seems like nothing I do will make it accept this SDP. The current function to handle it looks like this:

    private async onOffer(message: Messages.offer) {
        if (this.peer && this.peer.connectionState != 'disconnected') {
            console.warn("Streamer is already connected via RTC.");
            this.peer.close();
            this.peer = undefined;
        }
        
        const peer = new wrtc.RTCPeerConnection({
            iceServers: [{ urls: "stun:stunprotocol.org" }]
        });

        const audioTransceiver = peer.addTransceiver('audio');
        const videoTransceiver = peer.addTransceiver('video', { direction: 'sendrecv' });
        peer.createDataChannel("datachannel");

        console.log("Received offer SDP: ", message.sdp);

        this.peer = peer;

        peer.ontrack = e => {
            this.mediaStream = e.streams[0];
        };

        peer.onicecandidate = e => {
            if (e.candidate) {
                this.sendMessage(MessageHelpers.createMessage(Messages.iceCandidate, {
                    candidate: e.candidate
                }));
            }
        };

        const sdpOffer: RTCSessionDescriptionInit = {
            sdp: message.sdp,
            type: 'offer'
        };

        await peer.setRemoteDescription(new wrtc.RTCSessionDescription(sdpOffer));
        const answer = await peer.createAnswer();
        await peer.setLocalDescription(answer);

        this.sendMessage(MessageHelpers.createMessage(Messages.iceCandidate, { sdp: answer.sdp }));
        this.connectionPromise?.resolve(peer);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions