question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

peerConnection.SetRemoteDescription failed with "failed to parse IP address"

See original GitHub issue

Your environment.

  • Version:

github.com/pion/webrtc/v2 v2.0.12 h1:76s5SXtX0YEcnbGD95rfXe2yOc3FvW7vxjCo3NqTuLM= github.com/pion/webrtc/v2 v2.0.12/go.mod h1:O6ussUkKHJHV95xboN67X/t99jtejCWo/eRuw7viM6w=

  • Browser: chrome 77.0.3865.90(linux)
  • Other Information - firefox

What did you do?

I run you main.go to receive the post request to get the sdp.

peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{
		ICEServers: []webrtc.ICEServer{
			{
				URLs: []string{"stun:116.55.227.21:3478","turn:116.55.227.21:3478"},
				Username: "xxx",
				Credential:"xxx",
				CredentialType:webrtc.ICECredentialTypePassword,
			},
		},
	})
	if err != nil {
		panic(err)
	}
	peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
		fmt.Printf("Connection State has changed %s \n", connectionState.String())
	})
	vp8Track, err := peerConnection.NewTrack(webrtc.DefaultPayloadTypeH264, rand.Uint32(), "video", "pion2")
	if err != nil {
		log.Println("1",err)
		return
	}
	_, err = peerConnection.AddTrack(vp8Track)
	if err != nil {
		log.Println("2",err)
		return
	}
	// Allow us to receive 1 audio track, and 2 video tracks
	if _, err = peerConnection.AddTransceiver(webrtc.RTPCodecTypeAudio); err != nil {
		panic(err)
	} else if _, err = peerConnection.AddTransceiver(webrtc.RTPCodecTypeVideo); err != nil {
		panic(err)
	} else if _, err = peerConnection.AddTransceiver(webrtc.RTPCodecTypeVideo); err != nil {
		panic(err)
	}
	offer := webrtc.SessionDescription{
		Type: webrtc.SDPTypeOffer,
		SDP:  string(sd),
	}
	log.Println(offer)
	if err := peerConnection.SetRemoteDescription(offer); err != nil {
		log.Println("step 3",err)
		return
	}
	answer, err := peerConnection.CreateAnswer(nil)
	if err != nil {
		log.Println("4",err)
		return
	}

and a js

pc.createOffer({offerToReceiveVideo: true, offerToReceiveAudio: true}).then(d => pc.setLocalDescription(d)).catch(log)
pc.onicecandidate = event => {
  if (event.candidate === null) {
    document.getElementById('localSessionDescription').value = btoa(pc.localDescription.sdp)
    $.post("/recive", { data:btoa(pc.localDescription.sdp)} ,function(data){
      document.getElementById('remoteSessionDescription').value = data
      window.startSession()
    });
  }
}

What did you expect?

works on chrome

What happened?

it works on firefox 69.0.1, but failed on chrome 77.0.3865.90(linux) on step 3, with error “failed to parse IP address”

here is sdp offer from chrome:

/tmp/___go_build_github_com_deepch_RTSPtoWebRTC #gosetup
2019/09/26 16:37:47 {offer v=0
o=- 8756874911779966808 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:3257267946 1 udp 2113937151 83b4f79b-2bf8-4791-ba77-a63210c4b0a8.local 59380 typ host generation 0 network-cost 999
a=ice-ufrag:GGyZ
a=ice-pwd:BsewdZxOX7u0bV/HIbnyzp16
a=ice-options:trickle
a=fingerprint:sha-256 AA:8B:C9:68:3C:CB:BB:7E:F2:F5:FA:AA:57:DB:16:D1:F5:5F:D3:A4:F1:5B:39:BB:7F:32:11:4C:73:37:66:17
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=recvonly
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 122 127 121 125 107 108 109 124 120 123
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:3257267946 1 udp 2113937151 83b4f79b-2bf8-4791-ba77-a63210c4b0a8.local 45218 typ host generation 0 network-cost 999
a=ice-ufrag:GGyZ
a=ice-pwd:BsewdZxOX7u0bV/HIbnyzp16
a=ice-options:trickle
a=fingerprint:sha-256 AA:8B:C9:68:3C:CB:BB:7E:F2:F5:FA:AA:57:DB:16:D1:F5:5F:D3:A4:F1:5B:39:BB:7F:32:11:4C:73:37:66:17
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:13 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:12 urn:3gpp:video-orientation
a=extmap:2 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:11 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://tools.ietf.org/html/draft-ietf-avtext-framemarking-07
a=extmap:9 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/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 profile-id=0
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 VP9/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 profile-id=2
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:102 H264/90000
a=rtcp-fb:102 goog-remb
a=rtcp-fb:102 transport-cc
a=rtcp-fb:102 ccm fir
a=rtcp-fb:102 nack
a=rtcp-fb:102 nack pli
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:122 rtx/90000
a=fmtp:122 apt=102
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=0;profile-level-id=42001f
a=rtpmap:121 rtx/90000
a=fmtp:121 apt=127
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=125
a=rtpmap:108 H264/90000
a=rtcp-fb:108 goog-remb
a=rtcp-fb:108 transport-cc
a=rtcp-fb:108 ccm fir
a=rtcp-fb:108 nack
a=rtcp-fb:108 nack pli
a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:124 red/90000
a=rtpmap:120 rtx/90000
a=fmtp:120 apt=124
a=rtpmap:123 ulpfec/90000
 <nil>}
2019/09/26 16:37:47 3 failed to parse IP address

here is the sdp offer from firefox:

2019/09/26 16:49:16 {offer v=0
o=mozilla...THIS_IS_SDPARTA-69.0.1 1219220930751714801 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 08:3C:6F:D7:2D:15:3F:F8:0A:90:DD:2D:AE:95:85:41:CD:59:1C:95:53:44:35:57:26:F9:12:D3:25:F3:67:9F
a=group:BUNDLE 0 1
a=ice-options:trickle
a=msid-semantic:WMS *
m=audio 38489 UDP/TLS/RTP/SAVPF 109 9 0 8 101
c=IN IP4 10.1.14.151
a=candidate:0 1 UDP 2122252543 10.1.14.151 38489 typ host
a=candidate:1 1 TCP 2105524479 10.1.14.151 9 typ host tcptype active
a=candidate:0 2 UDP 2122252542 10.1.14.151 48054 typ host
a=candidate:1 2 TCP 2105524478 10.1.14.151 9 typ host tcptype active
a=recvonly
a=end-of-candidates
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2/recvonly urn:ietf:params:rtp-hdrext:csrc-audio-level
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
a=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1
a=fmtp:101 0-15
a=ice-pwd:705901f774e42ed032dc898dab33dda1
a=ice-ufrag:b6192bbe
a=mid:0
a=rtcp:48054 IN IP4 10.1.14.151
a=rtcp-mux
a=rtpmap:109 opus/48000/2
a=rtpmap:9 G722/8000/1
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=setup:actpass
a=ssrc:1044295777 cname:{c0b3ff8d-bc09-498f-8d3b-1f2236d6711a}
m=video 34499 UDP/TLS/RTP/SAVPF 120 121 126 97
c=IN IP4 10.1.14.151
a=candidate:0 1 UDP 2122252543 10.1.14.151 34499 typ host
a=candidate:1 1 TCP 2105524479 10.1.14.151 9 typ host tcptype active
a=candidate:0 2 UDP 2122252542 10.1.14.151 52308 typ host
a=candidate:1 2 TCP 2105524478 10.1.14.151 9 typ host tcptype active
a=recvonly
a=end-of-candidates
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:5 urn:ietf:params:rtp-hdrext:toffset
a=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1
a=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1
a=fmtp:120 max-fs=12288;max-fr=60
a=fmtp:121 max-fs=12288;max-fr=60
a=ice-pwd:705901f774e42ed032dc898dab33dda1
a=ice-ufrag:b6192bbe
a=mid:1
a=rtcp:52308 IN IP4 10.1.14.151
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 goog-remb
a=rtcp-fb:121 nack
a=rtcp-fb:121 nack pli
a=rtcp-fb:121 ccm fir
a=rtcp-fb:121 goog-remb
a=rtcp-fb:126 nack
a=rtcp-fb:126 nack pli
a=rtcp-fb:126 ccm fir
a=rtcp-fb:126 goog-remb
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 goog-remb
a=rtcp-mux
a=rtpmap:120 VP8/90000
a=rtpmap:121 VP9/90000
a=rtpmap:126 H264/90000
a=rtpmap:97 H264/90000
a=setup:actpass
a=ssrc:1641747560 cname:{c0b3ff8d-bc09-498f-8d3b-1f2236d6711a}
 <nil>}
Connection State has changed checking 

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
deepchcommented, Nov 30, 2019
0reactions
shijianzhongcommented, Jun 24, 2022

i alos meet some problem about hik nvr the same stream url. can play on the “vlc plyer”,but not work on the demo html page , can you help me. my dear brother WX20220624-161156@2x WX20220624-153808@2x的副本

Read more comments on GitHub >

github_iconTop Results From Across the Web

peerConnection.SetRemoteDescription failed with ... - GitHub
I write a golang web server to receive the post request to get the sdp. peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{ ...
Read more >
Why am I getting "Failed to set remote video description send ...
It works beautifully when running it in localhost under the http://localhost:4000/broadcaster.html in Chrome and then visiting my IP Address ...
Read more >
RTCPeerConnection.setRemoteDescription() - Web APIs | MDN
The RTCPeerConnection method setRemoteDescription() sets the specified session description as the remote peer's current offer or answer.
Read more >
app/webrtc/peerconnection.cc - external/webrtc/stable/talk
peerconnection.cc ... |hostname:port|, |[IPV6 address]:port|, |IPv4 address|:port, ... if (!session_->SetRemoteDescription(desc, &error)) {.
Read more >
JavaScript Session Establishment Protocol (JSEP)
SDP ABNF Syntax Acknowledgements Authors' Addresses Introduction This ... If parsing fails for any reason, processing MUST stop and an error MUST be ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found