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
11.9k stars 1.5k forks source link

WebRTC Playback: Sound only mono #2043

Closed zapf2000 closed 12 months ago

zapf2000 commented 1 year ago

Which version are you using?

v0.23.7

Which operating system are you using?

Describe the issue

When playing a WebRTC stream, the audio is only played in mono, even it shows 2 channels in webrtc internals (Chrome Linux latest version). On Firefox it works normally in Stereo. Chrome defaults to Mono playback. This is a 3 year old issue on Chrome. So if client is Chrome or Chromium, the SDP answer has to be ignered and forced to stereo=1 on WHEP side.

Describe how to replicate the issue

Ingest WebRTC Stream in Stereo via WHIP or WebRTC Listen on another client or the same one on a different audio device. Switch fader from left side to right side. Hear the same on both channels. I made some audio examples, that show the problem.

Audio Test.zip

Did you attach the server logs?

on WHIP side: a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 cbr=1;maxaveragebitrate=131072;minptime=10;sprop-stereo=1;stereo=1;useinbandfec=1

on WHEP side: a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 <<< This has to be ignored and player side has to add stereo=1 (or better the same values as provided on WHIP side).

No chance to set the custom parameters stereo=1 or sprop-stereo=1 on client side, because chrome defaults to Mono playback.

yes

Did you attach a network dump?

no

There is also a solution for that in ovenplayer: https://github.com/AirenSoft/OvenMediaEngine/issues/203 .... I think this can be used in WHEP Player too.

aler9 commented 12 months ago

Hello, thanks for reporting the issue, this is fixed with #2470.

aler9 commented 11 months ago

added in v1.2.0

github-actions[bot] commented 5 months ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.