srs
srs copied to clipboard
WebRTC: 推流,如何只推视频或者只推音频
描述(Description)
描述你遇到了什么问题(Please description your issue here) 希望Webrtc 推流时,可以只推视频或者只推音频。 SRS版本(Version): v4.0.95 SRS的配置如下(Config): rtc2rtmp.conf
重现(Replay)
重现Bug的步骤(How to replay bug?) 例如我只有麦克风,没有摄像头,可以选择只推音频。这里以只推音频为例: 1、将
srs.sdk.js中调用摄像头相关代码注释,启动 srs。
self.constraints = {
audio: true,
// video: {
// width: {ideal: 320, max: 576}
// }
};
// self.pc.addTransceiver("video", {direction: "sendonly"});
// self.pc.addTransceiver("video", {direction: "recvonly"});
2、此时webrtc可以实现只推音频,播放纯音频。但是 rtmp 流无法播放,第三方webrtc(jswebrtc)无法播放。 3、如果注释掉音频,只推送视频。此时webrtc可以实现只推视频,播放纯视频。但是 rtmp 流播放延迟大(约6s),第三方webrtc(jswebrtc)无法播放,并且导致srs服务崩溃。
期望行为(Expect)
可以正常只推视频或者只推音频,并且可以正常播放。
The reason for the error is that when webrtc only pushes audio, encoding fails when encountering NACK. It should be that NACK is not handled properly.
TRANS_BY_GPT3
I also want to know if the app's Flutter version has this bug. Thank you.
TRANS_BY_GPT3
Welcome Patch.
TRANS_BY_GPT3
Can you only push audio to HLS? It seems like there is no logic for segmenting and generating AAC in the code.
TRANS_BY_GPT3
Has this problem been resolved now? Test it out. Webrtc only pushes audio, rtmp pulling is possible, but it takes about 7 seconds for rtmp to receive data.
TRANS_BY_GPT3