mediamtx icon indicating copy to clipboard operation
mediamtx copied to clipboard

The server does not work with the flutter-whip client

Open romain63110 opened this issue 11 months ago • 0 comments

Which version are you using?

https://github.com/bluenviron/mediamtx/commit/f8d2343f7b55795fca9dd93b8800d6172c75439c

Which operating system are you using?

  • [ ] Linux amd64 standard
  • [ ] Linux amd64 Docker
  • [ ] Linux arm64 standard
  • [ ] Linux arm64 Docker
  • [ ] Linux arm7 standard
  • [ ] Linux arm7 Docker
  • [ ] Linux arm6 standard
  • [ ] Linux arm6 Docker
  • [ ] Windows amd64 standard
  • [ ] Windows amd64 Docker (WSL backend)
  • [ ] macOS amd64 standard
  • [ ] macOS amd64 Docker
  • [x] Other (Linux x86_64 standard)

Describe the issue

The server sends an error 400 to the flutter-whip client. I tried with another server https://director.millicast.com/api/whip/myStreamName and the client was working.

Describe how to replicate the issue

  1. start the server (192.168.1.29)
  2. publish with flutter-whip url (http://192.168.1.29:8889/mystream/whip)

Did you attach the server logs?

yes

Logs
2024/03/10 03:28:03 DEB [WebRTC] [conn 192.168.1.57:56778] [c->s] POST /mystream/whip HTTP/1.1
Host: 192.168.1.29:8889
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
Authorization: Bearer 7250d51a68b6d0bb7b634c31789d86b758c2eeeb5b5da676093e0b979819dba0
Connection: keep-alive
Content-Length: 4450
Content-Type: application/sdp; charset=utf-8
Origin: http://localhost:51401
Referer: http://localhost:51401/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

v=0 o=- 1442241617935927466 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=extmap-allow-mixed a=msid-semantic: WMS 10e53626-4b09-4b3a-b1e0-cd5fcb0c58b0 m=video 9 UDP/TLS/RTP/SAVPF 96 97 102 103 104 105 106 107 108 109 127 125 39 40 45 46 98 99 100 101 112 113 116 117 118 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:b6zJ a=ice-pwd:mTvAQ9U09+8kL2XV7QoMr952 a=ice-options:trickle a=fingerprint:sha-256 A2:57:12:96:85:AC:AA:87:B5:6D:6A:FF:FC:F3:7B:18:00:D7:46:E6:B9:77:20:93:AF:AF:15:95:E5:F5:AE:6F 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=sendonly a=msid:10e53626-4b09-4b3a-b1e0-cd5fcb0c58b0 cc7ffa34-0902-4a63-ae67-32dbe6c4fb22 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: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:103 rtx/90000 a=fmtp:103 apt=102 a=rtpmap:104 H264/90000 a=rtcp-fb:104 goog-remb a=rtcp-fb:104 transport-cc a=rtcp-fb:104 ccm fir a=rtcp-fb:104 nack a=rtcp-fb:104 nack pli a=fmtp:104 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f a=rtpmap:105 rtx/90000 a=fmtp:105 apt=104 a=rtpmap:106 H264/90000 a=rtcp-fb:106 goog-remb a=rtcp-fb:106 transport-cc a=rtcp-fb:106 ccm fir a=rtcp-fb:106 nack a=rtcp-fb:106 nack pli a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f a=rtpmap:107 rtx/90000 a=fmtp:107 apt=106 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: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=4d001f a=rtpmap:125 rtx/90000 a=fmtp:125 apt=127 a=rtpmap:39 H264/90000 a=rtcp-fb:39 goog-remb a=rtcp-fb:39 transport-cc a=rtcp-fb:39 ccm fir a=rtcp-fb:39 nack a=rtcp-fb:39 nack pli a=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f a=rtpmap:40 rtx/90000 a=fmtp:40 apt=39 a=rtpmap:45 AV1/90000 a=rtcp-fb:45 goog-remb a=rtcp-fb:45 transport-cc a=rtcp-fb:45 ccm fir a=rtcp-fb:45 nack a=rtcp-fb:45 nack pli a=rtpmap:46 rtx/90000 a=fmtp:46 apt=45 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:112 H264/90000 a=rtcp-fb:112 goog-remb a=rtcp-fb:112 transport-cc a=rtcp-fb:112 ccm fir a=rtcp-fb:112 nack a=rtcp-fb:112 nack pli a=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f a=rtpmap:113 rtx/90000 a=fmtp:113 apt=112 a=rtpmap:116 red/90000 a=rtpmap:117 rtx/90000 a=fmtp:117 apt=116 a=rtpmap:118 ulpfec/90000 a=ssrc-group:FID 291963546 2421854746 a=ssrc:291963546 cname:Q42iCtA6R58PUFIr a=ssrc:291963546 msid:10e53626-4b09-4b3a-b1e0-cd5fcb0c58b0 cc7ffa34-0902-4a63-ae67-32dbe6c4fb22 a=ssrc:2421854746 cname:Q42iCtA6R58PUFIr a=ssrc:2421854746 msid:10e53626-4b09-4b3a-b1e0-cd5fcb0c58b0 cc7ffa34-0902-4a63-ae67-32dbe6c4fb22

2024/03/10 03:28:03 DEB [WebRTC] [conn 192.168.1.57:56778] [s->c] HTTP/1.1 400 Bad Request Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 Server: mediamtx

(body of 32 bytes)

Did you attach a network dump?

no

Client Logs

Flutter logs
[flutter-whip] DEBUG: Initlize whip connection: mode = WhipMode.kSend, stream = 10e53626-4b09-4b3a-b1e0-cd5fcb0c58b0
js_primitives.dart:28 [flutter-whip] DEBUG: Sending offer: v=0
o=- 1442241617935927466 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=extmap-allow-mixed
a=msid-semantic: WMS 10e53626-4b09-4b3a-b1e0-cd5fcb0c58b0
m=video 9 UDP/TLS/RTP/SAVPF 96 97 102 103 104 105 106 107 108 109 127 125 39 40 45 46 98 99 100 101 112 113 116 117 118
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:b6zJ
a=ice-pwd:mTvAQ9U09+8kL2XV7QoMr952
a=ice-options:trickle
a=fingerprint:sha-256 A2:57:12:96:85:AC:AA:87:B5:6D:6A:FF:FC:F3:7B:18:00:D7:46:E6:B9:77:20:93:AF:AF:15:95:E5:F5:AE:6F
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=sendonly
a=msid:10e53626-4b09-4b3a-b1e0-cd5fcb0c58b0 cc7ffa34-0902-4a63-ae67-32dbe6c4fb22
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: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:103 rtx/90000
a=fmtp:103 apt=102
a=rtpmap:104 H264/90000
a=rtcp-fb:104 goog-remb
a=rtcp-fb:104 transport-cc
a=rtcp-fb:104 ccm fir
a=rtcp-fb:104 nack
a=rtcp-fb:104 nack pli
a=fmtp:104 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
a=rtpmap:105 rtx/90000
a=fmtp:105 apt=104
a=rtpmap:106 H264/90000
a=rtcp-fb:106 goog-remb
a=rtcp-fb:106 transport-cc
a=rtcp-fb:106 ccm fir
a=rtcp-fb:106 nack
a=rtcp-fb:106 nack pli
a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=106
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: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=4d001f
a=rtpmap:125 rtx/90000
a=fmtp:125 apt=127
a=rtpmap:39 H264/90000
a=rtcp-fb:39 goog-remb
a=rtcp-fb:39 transport-cc
a=rtcp-fb:39 ccm fir
a=rtcp-fb:39 nack
a=rtcp-fb:39 nack pli
a=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f
a=rtpmap:40 rtx/90000
a=fmtp:40 apt=39
a=rtpmap:45 AV1/90000
a=rtcp-fb:45 goog-remb
a=rtcp-fb:45 transport-cc
a=rtcp-fb:45 ccm fir
a=rtcp-fb:45 nack
a=rtcp-fb:45 nack pli
a=rtpmap:46 rtx/90000
a=fmtp:46 apt=45
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:112 H264/90000
a=rtcp-fb:112 goog-remb
a=rtcp-fb:112 transport-cc
a=rtcp-fb:112 ccm fir
a=rtcp-fb:112 nack
a=rtcp-fb:112 nack pli
a=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f
a=rtpmap:113 rtx/90000
a=fmtp:113 apt=112
a=rtpmap:116 red/90000
a=rtpmap:117 rtx/90000
a=fmtp:117 apt=116
a=rtpmap:118 ulpfec/90000
a=ssrc-group:FID 291963546 2421854746
a=ssrc:291963546 cname:Q42iCtA6R58PUFIr
a=ssrc:291963546 msid:10e53626-4b09-4b3a-b1e0-cd5fcb0c58b0 cc7ffa34-0902-4a63-ae67-32dbe6c4fb22
a=ssrc:2421854746 cname:Q42iCtA6R58PUFIr
a=ssrc:2421854746 msid:10e53626-4b09-4b3a-b1e0-cd5fcb0c58b0 cc7ffa34-0902-4a63-ae67-32dbe6c4fb22

js_util_patch.dart:110

   POST http://192.168.1.29:8889/mystream/whip 400 (Bad Request)

callMethod$ @ js_util_patch.dart:110 send @ browser_client.dart:101 (anonymous) @ async_patch.dart:45 runUnary @ zone.dart:1661 handleValue @ future_impl.dart:162 handleValueCallback @ future_impl.dart:838 _propagateToListeners @ future_impl.dart:867 [_completeWithValue] @ future_impl.dart:643 (anonymous) @ future_impl.dart:713 _microtaskLoop @ schedule_microtask.dart:40 _startMicrotaskLoop @ schedule_microtask.dart:49 (anonymous) @ async_patch.dart:181 Promise.then (async) _scheduleImmediateWithPromise @ async_patch.dart:179 _scheduleImmediate @ async_patch.dart:151 _scheduleAsyncCallback @ schedule_microtask.dart:69 _rootScheduleMicrotask @ zone.dart:1466 scheduleMicrotask @ zone.dart:1681 [_asyncCompleteWithValue] @ future_impl.dart:712 [_asyncComplete] @ future_impl.dart:672 complete @ future_impl.dart:44 (anonymous) @ js_util_patch.dart:483 Promise.then (async) promiseToFuture @ js_util_patch.dart:495 [dartx.setLocalDescription] @ html_dart2js.dart:27116 setLocalDescription @ rtc_peerconnection_impl.dart:297 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 setLocalDescription @ rtc_peerconnection_impl.dart:296 connect @ whip.dart:89 (anonymous) @ async_patch.dart:45 runUnary @ zone.dart:1661 handleValue @ future_impl.dart:162 handleValueCallback @ future_impl.dart:838 _propagateToListeners @ future_impl.dart:867 [_completeWithValue] @ future_impl.dart:643 (anonymous) @ future_impl.dart:713 _microtaskLoop @ schedule_microtask.dart:40 _startMicrotaskLoop @ schedule_microtask.dart:49 (anonymous) @ async_patch.dart:181 Promise.then (async) _scheduleImmediateWithPromise @ async_patch.dart:179 _scheduleImmediate @ async_patch.dart:151 _scheduleAsyncCallback @ schedule_microtask.dart:69 _rootScheduleMicrotask @ zone.dart:1466 scheduleMicrotask @ zone.dart:1681 [_asyncCompleteWithValue] @ future_impl.dart:712 [_asyncComplete] @ future_impl.dart:672 complete @ future_impl.dart:44 (anonymous) @ js_util_patch.dart:483 Promise.then (async) promiseToFuture @ js_util_patch.dart:495 createOffer @ rtc_peerconnection_impl.dart:262 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 createOffer @ rtc_peerconnection_impl.dart:259 connect @ whip.dart:83 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 connect @ whip.dart:80 _connect @ publish_sample.dart:104 (anonymous) @ async_patch.dart:45 runUnary @ zone.dart:1661 handleValue @ future_impl.dart:162 handleValueCallback @ future_impl.dart:838 _propagateToListeners @ future_impl.dart:867 [_completeWithValue] @ future_impl.dart:643 (anonymous) @ future_impl.dart:713 _microtaskLoop @ schedule_microtask.dart:40 _startMicrotaskLoop @ schedule_microtask.dart:49 (anonymous) @ async_patch.dart:181 Promise.then (async) _scheduleImmediateWithPromise @ async_patch.dart:179 _scheduleImmediate @ async_patch.dart:151 _scheduleAsyncCallback @ schedule_microtask.dart:69 _rootScheduleMicrotask @ zone.dart:1466 scheduleMicrotask @ zone.dart:1681 [_asyncCompleteWithValue] @ future_impl.dart:712 [_asyncComplete] @ future_impl.dart:672 complete @ future_impl.dart:44 (anonymous) @ js_util_patch.dart:483 Promise.then (async) promiseToFuture @ js_util_patch.dart:495 getUserMedia @ mediadevices_impl.dart:30 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 getUserMedia @ mediadevices_impl.dart:12 _connect @ publish_sample.dart:100 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 [_connect] @ publish_sample.dart:58 handleTap @ ink_well.dart:1183 invokeCallback @ recognizer.dart:315 handleTapUp @ tap.dart:652 [_checkUp] @ tap.dart:309 handlePrimaryPointer @ tap.dart:242 handleEvent @ recognizer.dart:670 [_dispatch] @ pointer_router.dart:98 (anonymous) @ pointer_router.dart:143 forEach @ linked_hash_map.dart:21 [_dispatchEventToRoutes] @ pointer_router.dart:141 route @ pointer_router.dart:127 handleEvent @ binding.dart:495 dispatchEvent @ binding.dart:475 dispatchEvent @ binding.dart:425 [_handlePointerEventImmediately] @ binding.dart:420 handlePointerEvent @ binding.dart:383 [_flushPointerEventQueue] @ binding.dart:330 [_handlePointerDataPacket] @ binding.dart:299 invoke1 @ platform_dispatcher.dart:1396 invokeOnPointerDataPacket @ platform_dispatcher.dart:321 [_sendToFramework] @ pointer_binding.dart:398 onPointerData @ pointer_binding.dart:224 (anonymous) @ pointer_binding.dart:1001 (anonymous) @ pointer_binding.dart:930 loggedHandler @ pointer_binding.dart:531 _checkAndCall @ operations.dart:550 dcall @ operations.dart:555 ret @ js_allow_interop_patch.dart:17 js_primitives.dart:28 [flutter-whip] ERROR: connect error: Exception: Failed to send offer: 400

romain63110 avatar Mar 10 '24 02:03 romain63110