ossrs / srs

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

WebRTC: Support stereo in SDP answer for players #3519

Closed superyhee closed 1 year ago

superyhee commented 1 year ago

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

Description

Please description your issue here

  1. SRS Version: v5.0-a4
  2. SRS Log:
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
  1. SRS Config:

    rtc { enabled on;

    @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc

    rtmp_to_rtc on;
    # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtc-to-rtmp
    rtc_to_rtmp on;
    keep_bframe off; 

    } `

Expect

通过rtc使用音乐文件推流,用rtc拉流或者rtc2rtmp拉流,音频不是立体声,需要在sdp的a=ftmp这一行中加入stereo=1代表双声道,stereo=0代表单声道 a=fmtp:111 minptime=10;useinbandfec=1; stereo=1; maxaveragebitrate=192000 我在客户端使用了下面的方式 async function run() { const offer = await peerConnection.createOffer(); offer.sdp = offer.sdp.replace('useinbandfec=1', 'useinbandfec=1; stereo=1; sprop-stereo=1;stereo=1; maxaveragebitrate=192000') await peerConnection.setLocalDescription(offer) 服务器端是否可以通过配置来支持stereo=1?

winlinvip commented 1 year ago

This is a feature, please update your issue and describe more details about the backgroud and use scenarios, or we will delete it.

superyhee commented 1 year ago

主要的使用场景是用rtc来实现网页直播,需要在直播中播放高质量的音乐,比如直播中播放立体声音乐,目前srs用rtc或者rtc2rtmp播放不是立体声