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
25.16k stars 5.31k forks source link

WebRTC: Set Audio Options like stereo=1 in WHEP player #3616

Open zapf2000 opened 1 year ago

zapf2000 commented 1 year ago

Note: Please read FAQ before file an issue, see #2716

Description

There are no options for setting webrtc audio parameters. By default the sound is very bad, caused by echo cancelling and other webrtc opus based default settings. It is quite important for WHIP ingest or webrtc broadcast that a pure audio mode can be activated (Stereo, no further audio processing).

  1. SRS Version: all

  2. SRS Log:

n.a.

  1. SRS Config:

n.a.

Replay

Ingest any audio/video codec doesn't matter what bitrate. Sound will always be bad in playback.

Expect

Add some options in WHEP/RTC player. For example: &stereo=1 Like it's done in vdo.ninja https://docs.vdo.ninja/advanced-settings/audio-parameters

This is how it looks like on WHIP/WHEP side:

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

No chance to set the custom parameters stereo=1 or sprop-stereo=1 on client side.

winlinvip commented 4 months ago

This issue is reasonable, and anyone is welcome to patch it.