ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.8k stars 5.28k forks source link

WebRTC: Audio downmix to mono in Chrome and Safari #2672

Open streamthing opened 2 years ago

streamthing commented 2 years ago

Description'

Please ensure that you maintain the markdown structure. Chrome and Safari has only mono audio. Same issue as: https://github.com/AirenSoft/OvenMediaEngine/issues/203 https://github.com/deepch/RTSPtoWebRTC/issues/105 https://github.com/ant-media/Ant-Media-Server/issues/3368

  1. SRS version: SRS/4.0.177(Leo) - Docker build
  2. The configuration of SRS is as follows:'

Please ensure that you maintain the markdown structure.

rtc_server {
    enabled on;
    listen 8000;
    candidate $CANDIDATE;
}

vhost __defaultVhost__ {
    rtc {
        enabled     on;
        rtmp_to_rtc on;
        rtc_to_rtmp off;
    }
}

Replay

Please ensure that you maintain the markdown structure.

  1. Open stereo WebRTC Stream in Chrome
  2. Change balance in OBS between left and right channel

Expect

Please make sure to maintain the markdown structure. Working stereo audio in Chrome and Safari

TRANS_BY_GPT3

winlinvip commented 2 years ago

So what's the problem for transcoding to mono?

streamthing commented 2 years ago

SRS isn't transcoding to mono. WebRTC from SRS is playing in Chrome/Safari in mono.

We are streaming live music in stereo, so user also should hear stereo in every browser. This was fixed in Oven, Ant Media and other servers. In SRS also should.

streamthing commented 2 years ago

I found the way to fix this. Created PR: https://github.com/ossrs/srs/pull/2683

xiaozhihong commented 2 years ago

@streamthing

  1. Open stereo WebRTC Stream in Chrome
  2. Change balance in OBS between left and right channel

Do you mean, publish rtmp stream using obs with single channel(mono), and play it by srs using webrtc?

xiaozhihong commented 2 years ago

@streamthing Another question, how can I confirm Chrome or Safira play audio in stereo or mono?

winlinvip commented 2 months ago

The stereo audio makes it as good as possible to get a higher quality.