bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
10.9k stars 1.41k forks source link

WebWtc no audio #3065

Closed centratelemedia closed 4 months ago

centratelemedia commented 4 months ago

Which version are you using?

v1.5.1

Which operating system are you using?

Describe the issue

Description

i can't hear audio when access from WebRtc, but i can hear audio using rtsp (vlc player)

Describe how to replicate the issue

  1. start the server
  2. publish audio/video with dashcam (Gps Tracker Device) to rtmp port 1935, dashcam contain two camera
  3. read with webrtc browser at port 8887 (https) using proxy, or 8886 (http) without proxy, both i can't hear audio
  4. read with vlc using rtsp protocol, audio/video both played well, rtsp://mydomain.com:8554/live/1/862798051910236 and rtsp://mydomain.com:8554/live/0/862798051910236

Did you attach the server logs?

yes

2024/02/24 09:57:36 INF [path live/1/862798051910236] [record] recording 2 tracks (H264, MPEG-4 Audio)
2024/02/24 09:57:36 INF [RTMP] [conn 182.1.98.46:56400] is publishing to path 'live/1/862798051910236', 2 tracks (H264, MPEG-4 Audio)
2024/02/24 09:57:36 DEB [WebRTC] [conn 127.0.0.1:62860] POST /live/1/862798051910236/whep
2024/02/24 09:57:36 DEB [WebRTC] [conn 127.0.0.1:62860] [c->s] POST /live/1/862798051910236/whep HTTP/1.1
Host: geagps.com:8886
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-GB,en;q=0.9,id-ID;q=0.8,id;q=0.7,en-US;q=0.6
Content-Length: 5388
Content-Type: application/sdp
Cookie: PHPSESSID=iqpprrm1v5hh2pi3r2iihu011j
Origin: https://mydomain.com:8886
Referer: https://mydomain.com:8886/live/1/862798051910236/
Sec-Ch-Ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Windows"
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
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
X-Forwarded-For: 36.68.223.195
X-Forwarded-Proto: https
X-Real-Ip: 36.68.223.195

v=0
o=- 718680997657725946 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=extmap-allow-mixed
a=msid-semantic: WMS
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:p7g4
a=ice-pwd:m4WgmZcQn5EoxpPCtUcQvSBb
a=ice-options:trickle
a=fingerprint:sha-256 15:26:95:CB:C9:18:A4:0A:0E:34:D7:56:B8:FA:00:A4:81:4F:57:CA:63:6B:D1:4E:8C:4B:34:3A:E3:B9:DF:42
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:- e294bab7-a270-4561-8764-f885f64ace10
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 2493343202 3638886947
a=ssrc:2493343202 cname:zBKCM7CY1P9qIuTS
a=ssrc:2493343202 msid:- e294bab7-a270-4561-8764-f885f64ace10
a=ssrc:3638886947 cname:zBKCM7CY1P9qIuTS
a=ssrc:3638886947 msid:- e294bab7-a270-4561-8764-f885f64ace10
m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:p7g4
a=ice-pwd:m4WgmZcQn5EoxpPCtUcQvSBb
a=ice-options:trickle
a=fingerprint:sha-256 15:26:95:CB:C9:18:A4:0A:0E:34:D7:56:B8:FA:00:A4:81:4F:57:CA:63:6B:D1:4E:8C:4B:34:3A:E3:B9:DF:42
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:- c06f2ae8-dd84-4056-8652-aa3e2047c9e6
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1;stereo=1;sprop-stereo=1
a=rtpmap:63 red/48000/2
a=fmtp:63 111/111
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:126 telephone-event/8000
a=ssrc:2666731951 cname:zBKCM7CY1P9qIuTS
a=ssrc:2666731951 msid:- c06f2ae8-dd84-4056-8652-aa3e2047c9e6

2024/02/24 09:57:36 INF [WebRTC] [session e4394008] created by 127.0.0.1:62860
2024/02/24 09:57:36 DEB [WebRTC] [session e4394008] peer connection state: connecting
2024/02/24 09:57:36 DEB [WebRTC] [conn 127.0.0.1:62860] [s->c] HTTP/1.1 201 Created
Accept-Patch: application/trickle-ice-sdpfrag
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, ID, Accept-Patch, Link, Location
Content-Type: application/sdp
Etag: *
Id: e4394008-06f6-46ad-bcf1-29e9d861166e
Location: whep/b56a95b7-99b1-42a0-ba26-f2fa1d1102e4
Server: mediamtx

(body of 2205 bytes)
2024/02/24 09:57:36 DEB [WebRTC] [conn 127.0.0.1:62860] PATCH /live/0/862798051910236/whep/d88eb5f8-8185-453e-b50a-8aa091cca1c6
2024/02/24 09:57:36 DEB [WebRTC] [conn 127.0.0.1:62860] [c->s] PATCH /live/0/862798051910236/whep/d88eb5f8-8185-453e-b50a-8aa091cca1c6 HTTP/1.1
Host: geagps.com:8886
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-GB,en;q=0.9,id-ID;q=0.8,id;q=0.7,en-US;q=0.6
Cache-Control: max-age=0
Content-Length: 806
Content-Type: application/trickle-ice-sdpfrag
Cookie: PHPSESSID=iqpprrm1v5hh2pi3r2iihu011j
If-Match: *
Origin: https://mydomain.com:8886
Referer: https://mydomain.com:8886/live/0/862798051910236/
Sec-Ch-Ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Windows"
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
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
X-Forwarded-For: 36.68.223.195
X-Forwarded-Proto: https
X-Real-Ip: 36.68.223.195

a=ice-ufrag:xUUc
a=ice-pwd:o44FdeFSlq6ww46+zKPLdHNV
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
a=mid:0
a=candidate:1626563689 1 udp 2113937151 eccb0719-36fe-4cdf-b0c4-495f9566867b.local 57157 typ host generation 0 ufrag xUUc network-cost 999
a=candidate:3177862424 1 udp 2113939711 b28784e6-84da-4b6e-830c-2db985956a4f.local 57158 typ host generation 0 ufrag xUUc network-cost 999
m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126
a=mid:1
a=candidate:1626563689 1 udp 2113937151 eccb0719-36fe-4cdf-b0c4-495f9566867b.local 57159 typ host generation 0 ufrag xUUc network-cost 999
a=candidate:3177862424 1 udp 2113939711 b28784e6-84da-4b6e-830c-2db985956a4f.local 57160 typ host generation 0 ufrag xUUc network-cost 999

2024/02/24 09:57:36 DEB [WebRTC] [conn 127.0.0.1:62860] [s->c] HTTP/1.1 204 No Content
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Server: mediamtx

2024/02/24 09:57:36 DEB [WebRTC] [conn 127.0.0.1:62860] PATCH /live/1/862798051910236/whep/b56a95b7-99b1-42a0-ba26-f2fa1d1102e4
2024/02/24 09:57:36 DEB [WebRTC] [conn 127.0.0.1:62860] [c->s] PATCH /live/1/862798051910236/whep/b56a95b7-99b1-42a0-ba26-f2fa1d1102e4 HTTP/1.1
Host: geagps.com:8886
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-GB,en;q=0.9,id-ID;q=0.8,id;q=0.7,en-US;q=0.6
Cache-Control: max-age=0
Content-Length: 806
Content-Type: application/trickle-ice-sdpfrag
Cookie: PHPSESSID=iqpprrm1v5hh2pi3r2iihu011j
If-Match: *
Origin: https://geagps.com:8886
Referer: https://geagps.com:8886/live/1/862798051910236/
Sec-Ch-Ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Windows"
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
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
X-Forwarded-For: 36.68.223.195
X-Forwarded-Proto: https
X-Real-Ip: 36.68.223.195

a=ice-ufrag:p7g4
a=ice-pwd:m4WgmZcQn5EoxpPCtUcQvSBb
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
a=mid:0
a=candidate:2748368814 1 udp 2113937151 f122cbda-2abc-46da-8ed8-28e920c08560.local 57161 typ host generation 0 ufrag p7g4 network-cost 999
a=candidate:2118776543 1 udp 2113939711 24c325fd-36c9-4369-b8f1-65017cb37238.local 57162 typ host generation 0 ufrag p7g4 network-cost 999
m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126
a=mid:1
a=candidate:2748368814 1 udp 2113937151 f122cbda-2abc-46da-8ed8-28e920c08560.local 57163 typ host generation 0 ufrag p7g4 network-cost 999
a=candidate:2118776543 1 udp 2113939711 24c325fd-36c9-4369-b8f1-65017cb37238.local 57164 typ host generation 0 ufrag p7g4 network-cost 999

2024/02/24 09:57:36 DEB [WebRTC] [conn 127.0.0.1:62860] [s->c] HTTP/1.1 204 No Content
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Server: mediamtx

2024/02/24 09:57:36 DEB [WebRTC] [session fc18c2c6] peer connection state: connected
2024/02/24 09:57:36 INF [WebRTC] [session fc18c2c6] peer connection established, local candidate: host/udp/194.233.90.76/8189, remote candidate: prflx/udp/36.68.223.195/10861
2024/02/24 09:57:36 INF [WebRTC] [session fc18c2c6] is reading from path 'live/0/862798051910236', 1 track (H264)
2024/02/24 09:57:36 DEB [WebRTC] [session e4394008] peer connection state: connected
2024/02/24 09:57:36 INF [WebRTC] [session e4394008] peer connection established, local candidate: host/udp/194.233.90.76/8189, remote candidate: prflx/udp/36.68.223.195/35976
2024/02/24 09:57:36 INF [WebRTC] [session e4394008] is reading from path 'live/1/862798051910236', 1 track (H264)
2024/02/24 09:57:38 DEB [path live/0/862798051910236] [record] creating segment ./recordings/live/0/862798051910236/2024-02-24_09-57-38-029867.mp4
2024/02/24 09:57:38 DEB [path live/1/862798051910236] [record] creating segment ./recordings/live/1/862798051910236/2024-02-24_09-57-38-162580.mp4
2024/02/24 09:57:38 DEB [path live/0/862798051910236] [record] closing segment ./recordings/live/0/862798051910236/2024-02-24_09-57-38-029867.mp4
2024/02/24 09:57:38 DEB [path live/0/862798051910236] [record] creating segment ./recordings/live/0/862798051910236/2024-02-24_09-57-38-070739.mp4
2024/02/24 09:57:38 DEB [path live/1/862798051910236] [record] closing segment ./recordings/live/1/862798051910236/2024-02-24_09-57-38-162580.mp4
2024/02/24 09:57:38 DEB [path live/1/862798051910236] [record] creating segment ./recordings/live/1/862798051910236/2024-02-24_09-57-38-251719.mp4

Did you attach a network dump?

no

centratelemedia commented 4 months ago

after reading webrtc audio support, the problem is MPEG-4 audio not support by webrtc, is possible mediamtx automatic transocode MPEG-4 Audio to opus?

aler9 commented 4 months ago

Instructions on how to perform re-encoding are available in the README.