meetecho / simple-whip-client

Simple WHIP Client (based on GStreamer's webrtcbin)
GNU General Public License v3.0
71 stars 19 forks source link

Simple-whip-client not working with mediamtx server #22

Open RomanED opened 1 week ago

RomanED commented 1 week ago

I have launched mediamtx, the log of which I am attaching: 2024/09/23 23:56:36 INF MediaMTX v1.9.0 2024/09/23 23:56:36 INF configuration loaded from /home/roman/Downloads/mediamtx_v1.9.0_linux_amd64/mediamtx.yml 2024/09/23 23:56:36 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP) 2024/09/23 23:56:36 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP) 2024/09/23 23:56:36 INF [SRT] listener opened on :8890 (UDP) 2024/09/23 23:56:55 INF [WebRTC] [session 2b019270] created by [::1]:50222 2024/09/23 23:57:05 INF [WebRTC] [session 2b019270] closed: deadline exceeded while waiting connection

Next, I try to run the whip-client, and I get the following output in the log. Can you tell me what the problem is? I really need help

./whip-client -u http://localhost:8889/mystream/whip -V "videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc ! rtph264pay pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=97" -S stun://stun.l.google.com:19302 -F -l 7

--------------------
Simple WHIP client
------------------

WHIP endpoint:  http://localhost:8889/mystream/whip
Bearer Token:   (none)
Trickle ICE:    yes (HTTP PATCH)
Auto STUN/TURN: no
STUN server:    stun://stun.l.google.com:19302
TURN server:    (none)
[WARN] Can't force TURN, no TURN servers provided
Audio pipeline: (none)
Video pipeline: videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc ! rtph264pay pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=97

[WHIP] Initializing the GStreamer pipeline:
webrtcbin name=sendonly bundle-policy=0  stun-server=stun://stun.l.google.com:19302  videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc ! rtph264pay pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=97 ! sendonly. 
[WHIP] Configured jitter-buffer size (latency) for PeerConnection to 200ms
[WHIP] Starting the GStreamer pipeline
[WHIP] Creating offer
[WHIP] Offer created
[WHIP] Setting local description
[WHIP] Sending SDP offer (800 bytes)
v=0
o=- 6796038610334001675 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
m=video 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:0EIQFOP9aORx9K2Ajt16lzc7ju+S0V2V
a=ice-pwd:cJk+n0fib3LRm95rmLD1wdvLwkEJK4QR
a=rtcp-mux
a=rtcp-rsize
a=sendonly
a=rtpmap:97 H264/90000
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 transport-cc
a=framerate:30
a=fmtp:97 packetization-mode=1;sprop-parameter-sets=Z0LAFdkBQfsBagwMDUoAAAMAAgAAAwB5HixckA==,aMuMsg==;profile-level-id=42c015;level-asymmetry-allowed=1
a=ssrc:2 msid:user2643298913@host-254adb41 webrtctransceiver0
a=ssrc:2 cname:user2643298913@host-254adb41
a=mid:video0
a=fingerprint:sha-256 81:48:D7:75:6B:C1:D6:4E:50:FC:16:DC:0E:45:D9:F5:07:43:24:41:FD:CE:A3:BA:09:7B:69:E1:B8:E7:FE:C9
a=rtcp-mux-only

[WHIP] Resource URL: http://localhost:8889/mystream/whip/4ec47aac-73c4-4720-a8bc-71df5eae69ae
[WHIP] Received SDP answer (812 bytes)
v=0
o=- 7399780406082339111 1727121415 IN IP4 0.0.0.0
s=-
t=0 0
a=msid-semantic:WMS*
a=fingerprint:sha-256 3C:C4:50:7E:0B:52:41:90:75:B8:87:50:C7:46:92:CF:86:FD:A7:39:2D:56:D5:1B:EA:D7:38:24:3D:1C:69:69
m=video 0 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=setup:active
a=mid:video0
a=ice-ufrag:YtoGOACKmNCZYJLv
a=ice-pwd:pPQqXwggWBbREKNyAQTnnrekJNKUwiPv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:97 H264/90000
a=fmtp:97 packetization-mode=1;sprop-parameter-sets=Z0LAFdkBQfsBagwMDUoAAAMAAgAAAwB5HixckA==,aMuMsg==;profile-level-id=42c015;level-asymmetry-allowed=1
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 transport-cc 
a=recvonly
a=candidate:2530633398 1 udp 2130706431 192.168.68.200 8189 typ host
a=candidate:2530633398 2 udp 2130706431 192.168.68.200 8189 typ host
a=end-of-candidates

  -- Found candidate: candidate:2530633398 1 udp 2130706431 192.168.68.200 8189 typ host
  -- Found candidate: candidate:2530633398 2 udp 2130706431 192.168.68.200 8189 typ host
[WHIP] Setting remote description
[WARN] GStreamer trying to create a new offer, but we don't support renegotiations yet...
[WHIP] ICE gathering started...
[WHIP] Sending candidates: candidate:1 1 UDP 2015363327 192.168.68.200 47736 typ host
[WHIP] Sending candidates: candidate:2 1 TCP 1015021823 192.168.68.200 9 typ host tcptype active
[WHIP] Sending candidates: candidate:3 1 TCP 1010827519 192.168.68.200 46029 typ host tcptype passive
[WHIP] Sending candidates: candidate:4 1 UDP 2015363583 fe80::a4c8:ba23:f1e6:2c8f 46286 typ host
[WHIP] Sending candidates: candidate:5 1 TCP 1015022079 fe80::a4c8:ba23:f1e6:2c8f 9 typ host tcptype active
[WHIP] Sending candidates: candidate:6 1 TCP 1010827775 fe80::a4c8:ba23:f1e6:2c8f 55779 typ host tcptype passive
[WHIP] Sending candidates: candidate:7 1 UDP 1679819007 94.253.2.56 7812 typ srflx raddr 192.168.68.200 rport 47736
[WHIP] Sending candidates: candidate:8 1 TCP 847249663 94.253.2.56 9 typ srflx raddr 192.168.68.200 rport 9 tcptype active
[WHIP] Sending candidates: candidate:9 1 TCP 843055359 94.253.2.56 46029 typ srflx raddr 192.168.68.200 rport 46029 tcptype passive
[WARN]  [trickle] 400 Bad Request
[WHIP] ICE gathering completed
[WHIP] Sending candidates: end-of-candidates
[WARN]  [trickle] 400 Bad Request
lminiero commented 1 week ago
[WARN]  [trickle] 400 Bad Request

Whatever this MediaMTX thing is, it doesn't seem to support trickle. Try disabling it in the WHIP client too by passing --no-trickle.

RomanED commented 5 days ago
[WARN]  [trickle] 400 Bad Request

Whatever this MediaMTX thing is, it doesn't seem to support trickle. Try disabling it in the WHIP client too by passing --no-trickle.

@lminiero MediaMTX https://github.com/bluenviron/mediamtx

This is mediaserver , i tried with --no-trickle, it still doesn't work and the output is like this:

./whip-client -u http://localhost:8889/mystream/whip -V "videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc ! rtph264pay pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=97" -S stun://stun.l.google.com:19302 -F -l 7 --no-trickle

--------------------
Simple WHIP client
------------------

WHIP endpoint:  http://localhost:8889/mystream/whip
Bearer Token:   (none)
Trickle ICE:    no (candidates in SDP offer)
Auto STUN/TURN: no
STUN server:    stun://stun.l.google.com:19302
TURN server:    (none)
[WARN] Can't force TURN, no TURN servers provided
Audio pipeline: (none)
Video pipeline: videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc ! rtph264pay pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=97

[WHIP] Initializing the GStreamer pipeline:
webrtcbin name=sendonly bundle-policy=0  stun-server=stun://stun.l.google.com:19302  videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc ! rtph264pay pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=97 ! sendonly. 
[WHIP] Configured jitter-buffer size (latency) for PeerConnection to 200ms
[WHIP] Starting the GStreamer pipeline
[WHIP] Creating offer
[WHIP] Offer created
[WHIP] Setting local description
[WHIP] ICE gathering started...
[WHIP] ICE gathering completed
[WHIP] Sending SDP offer (800 bytes)
[WHIP] Adding candidate to SDP: candidate:1 1 UDP 2015363327 192.168.68.200 43857 typ host
[WHIP] Adding candidate to SDP: candidate:2 1 TCP 1015021823 192.168.68.200 9 typ host tcptype active
[WHIP] Adding candidate to SDP: candidate:3 1 TCP 1010827519 192.168.68.200 48241 typ host tcptype passive
[WHIP] Adding candidate to SDP: candidate:4 1 UDP 2015363583 fe80::a4c8:ba23:f1e6:2c8f 34322 typ host
[WHIP] Adding candidate to SDP: candidate:5 1 TCP 1015022079 fe80::a4c8:ba23:f1e6:2c8f 9 typ host tcptype active
[WHIP] Adding candidate to SDP: candidate:6 1 TCP 1010827775 fe80::a4c8:ba23:f1e6:2c8f 32895 typ host tcptype passive
[WHIP] Adding candidate to SDP: candidate:7 1 UDP 1679819007 94.253.2.56 12629 typ srflx raddr 192.168.68.200 rport 43857
[WHIP] Adding candidate to SDP: candidate:8 1 TCP 847249663 94.253.2.56 9 typ srflx raddr 192.168.68.200 rport 9 tcptype active
[WHIP] Adding candidate to SDP: candidate:9 1 TCP 843055359 94.253.2.56 48241 typ srflx raddr 192.168.68.200 rport 48241 tcptype passive
[WHIP] Adding candidate to SDP: end-of-candidates
v=0
o=- 6161727801002485254 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
m=video 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:sXUOWdgcStJiLqlW4njBTE2Qn9P//jkJ
a=ice-pwd:ZOFcl2jFxP8N+QYzCSD0XzcG5nT+oz3H
a=rtcp-mux
a=rtcp-rsize
a=sendonly
a=rtpmap:97 H264/90000
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 transport-cc
a=framerate:30
a=fmtp:97 packetization-mode=1;sprop-parameter-sets=Z0LAFdkBQfsBagwMDUoAAAMAAgAAAwB5HixckA==,aMuMsg==;profile-level-id=42c015;level-asymmetry-allowed=1
a=ssrc:2 msid:user2069033370@host-ddccfccf webrtctransceiver0
a=ssrc:2 cname:user2069033370@host-ddccfccf
a=mid:video0
a=fingerprint:sha-256 61:5B:6B:32:8E:99:F7:6B:FE:C4:E7:93:FA:D6:77:CD:F8:76:28:F0:D1:B6:97:52:02:57:B8:96:77:1F:0C:49
a=rtcp-mux-only
a=candidate:1 1 UDP 2015363327 192.168.68.200 43857 typ host
a=candidate:2 1 TCP 1015021823 192.168.68.200 9 typ host tcptype active
a=candidate:3 1 TCP 1010827519 192.168.68.200 48241 typ host tcptype passive
a=candidate:4 1 UDP 2015363583 fe80::a4c8:ba23:f1e6:2c8f 34322 typ host
a=candidate:5 1 TCP 1015022079 fe80::a4c8:ba23:f1e6:2c8f 9 typ host tcptype active
a=candidate:6 1 TCP 1010827775 fe80::a4c8:ba23:f1e6:2c8f 32895 typ host tcptype passive
a=candidate:7 1 UDP 1679819007 94.253.2.56 12629 typ srflx raddr 192.168.68.200 rport 43857
a=candidate:8 1 TCP 847249663 94.253.2.56 9 typ srflx raddr 192.168.68.200 rport 9 tcptype active
a=candidate:9 1 TCP 843055359 94.253.2.56 48241 typ srflx raddr 192.168.68.200 rport 48241 tcptype passive
a=end-of-candidates

[WHIP] Resource URL: http://localhost:8889/mystream/whip/a50f5fd5-83b7-4688-a704-37db7e7e297d
[WHIP] Received SDP answer (812 bytes)
v=0
o=- 2810940607458091603 1727299263 IN IP4 0.0.0.0
s=-
t=0 0
a=msid-semantic:WMS*
a=fingerprint:sha-256 33:43:52:D9:B2:34:19:C5:B3:C7:F8:8E:68:36:5E:33:7A:1B:30:AE:4B:01:37:5A:F2:F9:79:61:8D:43:46:4A
m=video 0 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=setup:active
a=mid:video0
a=ice-ufrag:ABegxqFHPHfOCcOA
a=ice-pwd:zxyzlddgheHGzOAAfhZLGwtsOvvAlxxg
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:97 H264/90000
a=fmtp:97 packetization-mode=1;sprop-parameter-sets=Z0LAFdkBQfsBagwMDUoAAAMAAgAAAwB5HixckA==,aMuMsg==;profile-level-id=42c015;level-asymmetry-allowed=1
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 transport-cc 
a=recvonly
a=candidate:2530633398 1 udp 2130706431 192.168.68.200 8189 typ host
a=candidate:2530633398 2 udp 2130706431 192.168.68.200 8189 typ host
a=end-of-candidates

  -- Found candidate: candidate:2530633398 1 udp 2130706431 192.168.68.200 8189 typ host
  -- Found candidate: candidate:2530633398 2 udp 2130706431 192.168.68.200 8189 typ host
[WHIP] Setting remote description
[WARN] GStreamer trying to create a new offer, but we don't support renegotiations yet...

and mediaMTX log:

2024/09/26 01:20:47 INF MediaMTX v1.9.0
2024/09/26 01:20:47 INF configuration loaded from /home/roman/Downloads/mediamtx_v1.9.0_linux_amd64/mediamtx.yml
2024/09/26 01:20:47 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2024/09/26 01:20:47 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP)
2024/09/26 01:20:47 INF [SRT] listener opened on :8890 (UDP)
2024/09/26 01:21:03 INF [WebRTC] [session bbf18c58] created by [::1]:42474
2024/09/26 01:21:13 INF [WebRTC] [session bbf18c58] closed: deadline exceeded while waiting connection