kevmo314 / tinywhip

9 stars 2 forks source link

Seems to not work with latest OBS 30.1.0 #2

Closed neilyoung closed 5 months ago

neilyoung commented 5 months ago
2024/03/19 11:49:05 Connection State has changed checking
2024/03/19 11:49:35 Connection State has changed failed
image

Here the SDP exchange as seen by Wireshark (public addresses obfuscated):

// Offer
POST /123 HTTP/1.1
Host: localhost:8080
Accept: */*
Content-Type: application/sdp
User-Agent: Mozilla/5.0 (OBS-Studio/30.1.0; Mac OS X; en-US)
Content-Length: 1266

v=0
o=rtc 3877212184 0 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=group:LS 0 1
a=msid-semantic:WMS *
a=setup:actpass
a=ice-ufrag:nxcM
a=ice-pwd:ezjAjgSSLLvbRhUA1zc6Se
a=ice-options:ice2,trickle
a=fingerprint:sha-256 4E:7F:77:DB:7E:A3:A6:4E:5D:27:EB:39:D2:1B:96:9F:91:C9:58:8B:30:B4:AA:0F:77:60:5A:F3:86:60:03:F3
m=audio 57249 UDP/TLS/RTP/SAVPF 111
c=IN IP4 192.168.188.53
a=mid:0
a=sendonly
a=ssrc:3388068600 cname:Yuu1KDxQcc3L5CpY
a=ssrc:3388068600 msid:XmQSKutZo7zYcEQl XmQSKutZo7zYcEQl-audio
a=msid:XmQSKutZo7zYcEQl XmQSKutZo7zYcEQl-audio
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10;maxaveragebitrate=96000;stereo=1;sprop-stereo=1;useinbandfec=1
a=candidate:2 1 UDP 2130706175 fd00::xx.xx.xx:acaf 57249 typ host
a=candidate:1 1 UDP 2122317823 192.168.188.53 57249 typ host
a=end-of-candidates
m=video 57249 UDP/TLS/RTP/SAVPF 96
c=IN IP4 192.168.188.53
a=mid:1
a=sendonly
a=ssrc:3388068601 cname:Yuu1KDxQcc3L5CpY
a=ssrc:3388068601 msid:XmQSKutZo7zYcEQl XmQSKutZo7zYcEQl-video
a=msid:XmQSKutZo7zYcEQl XmQSKutZo7zYcEQl-video
a=rtcp-mux
a=rtpmap:96 H264/90000
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 goog-remb
a=fmtp:96 profile-level-id=42e01f;packetization-mode=1;level-asymmetry-allowed=1

// Answer
HTTP/1.1 200 OK
Content-Type: application/sdp
Location: http://localhost:8080/f684ea96-8a16-4870-896d-f4d362bc68ae
Date: Tue, 19 Mar 2024 10:49:05 GMT
Content-Length: 1382

v=0
o=- 476892899614431529 1710845345 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 75:D5:70:A7:58:EB:B8:17:22:0D:9A:BB:00:7A:2D:8A:92:90:08:A6:78:9D:5A:D3:BD:0D:5F:B4:7C:64:86:4D
a=group:BUNDLE 0 1
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=setup:active
a=mid:0
a=ice-ufrag:SDNizqfpYWtavMCS
a=ice-pwd:vCWxMbOPCmLGAolLVCHSYrpqiQtZsSrv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10;maxaveragebitrate=96000;stereo=1;sprop-stereo=1;useinbandfec=1
a=recvonly
a=candidate:2043500730 1 udp 2130706431 192.168.188.53 57812 typ host
a=candidate:2043500730 2 udp 2130706431 192.168.188.53 57812 typ host
a=candidate:1002617216 1 udp 1694498815 xx.xx.xx.xx 63664 typ srflx raddr 0.0.0.0 rport 63664
a=candidate:1002617216 2 udp 1694498815 xx.xx.xx.xx 63664 typ srflx raddr 0.0.0.0 rport 63664
a=candidate:1473023460 1 udp 2130706431 fd00::xx.xx.xx:acaf 51913 typ host
a=candidate:1473023460 2 udp 2130706431 fd00::xx.xx.xx:acaf 51913 typ host
a=end-of-candidates
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=setup:active
a=mid:1
a=ice-ufrag:SDNizqfpYWtavMCS
a=ice-pwd:vCWxMbOPCmLGAolLVCHSYrpqiQtZsSrv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=42e01f;packetization-mode=1;level-asymmetry-allowed=1
a=rtcp-fb:96 nack 
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 goog-remb 
a=recvonly

Any idea, what could go wrong? The SDP doesn't look too bad to me.

Looks like an ICE problem...

neilyoung commented 5 months ago

I checked the code and found, that you are entering WHEP mode if the id is != "". Changed the publish URL to "/", but same result

The problem seems to be the missing 201 status code.

Trying to figure out how to set this alongside with the other header manipulations here (neither a go fan nor pro):

            w.Header().Set("Content-Type", "application/sdp")
            w.Header().Set("Location", fmt.Sprintf("http://%s/%s", r.Host, pcid))
neilyoung commented 5 months ago

Yes, this is the problem. Creating a PR

neilyoung commented 5 months ago

https://github.com/kevmo314/tinywhip/pull/3