简体   繁体   English

Chrome WebRTC中没有ssrc标签的单流音频/视频

[英]Single stream audio/video in Chrome WebRTC without ssrc tags

Is single stream audio (or video) via Chrome's WebRTC possible when you strip a=ssrc lines from the SDP? 从SDP剥离a = ssrc线时,是否可以通过Chrome浏览器的WebRTC进行单流音频(或视频)播放?

I have tried filtering out a=ssrc lines (with the code below), but single stream audio did not work. 我尝试过滤掉a = ssrc行(使用下面的代码),但是单流音频不起作用。 I tried also single stream video and renaming instead of removing lines with the same result. 我还尝试了单流视频和重命名,而不是删除行,结果相同。 I modify both offer and answer SDPs. 我同时修改了报价和答复SDP。 Interestingly, this filtering works when you try sending SDPs with both audio & video - audio (only) will work in such scenario. 有趣的是,当您尝试同时发送带有音频和视频的SDP时,此过滤有效-音频(仅)在这种情况下可以使用。 However I had issues with re-negotiation in such scenario in our app, so this is probably not a valid solution. 但是在这种情况下,我的应用程序在重新协商时遇到了问题,因此这可能不是有效的解决方案。

You can see minimum example with the single stream audio / video in this repo: https://github.com/Tev-work/webrtc-audio-demo . 您可以在此仓库中看到有关单流音频/视频的最小示例: https : //github.com/Tev-work/webrtc-audio-demo

If it is possible, can you please provide minimal example of code with working audio? 如果有可能,请提供带有工作音频的最小代码示例吗? Preferably using the repo above, what should the modifySdp function (in public/client.js ) do? 最好使用上面的repo, ModifySdp函数(在public / client.js中 )应该做什么?

Currently it modifies sdp with this code: 目前,它使用以下代码修改sdp:

sdp = sdp.replace(/a=ssrc/g, 'a=xssrc');
sdp = sdp.replace(/a=msid-semantic/g, 'a=xmsid-semantic');
sdp = sdp.replace(/a=mid/g, 'a=xmid');
sdp = sdp.replace(/a=group:BUNDLE/g, 'a=xgroup:BUNDLE');

If it is not possible, do you know whether such limitation has been officialy stated somewhere (please link it), or it just at some point became unworkable? 如果不可能,您是否知道这种限制是否已经在某处正式提出(请链接),或者只是在某个时候变得不可行? It seems like it was working before (around M29, see comments here https://bugs.chromium.org/p/webrtc/issues/detail?id=1941 - no mention that this was not supposed to be working). 似乎之前它正在工作(在M29附近,请参见此处的评论https://bugs.chromium.org/p/webrtc/issues/detail?id=1941-不用说这不起作用了)。

Motivation: We are sometimes sending SDPs via SIP PBXs, which sometimes filter out SSRC lines. 动机:我们有时会通过SIP PBX发送SDP,有时会过滤掉SSRC线路。 Supporting multiple streams in such situations is obviously out of question (maybe with some server side hacking streams?), but supporting at least audio-only for such scenarios would be useful for us. 在这种情况下支持多个流显然是毫无疑问的(也许有一些服务器端的黑客流吗?),但是至少在这种情况下仅支持音频对我们很有用。

that should still be possible, even though there are some side-effects like (legacy) getStats not recognizing the stream, see (this bug)[ https://bugs.chromium.org/p/webrtc/issues/detail?id=3342] . 即使有一些副作用(例如(传统)getStats无法识别流),这仍然应该可行,请参阅(此错误)[ https://bugs.chromium.org/p/webrtc/issues/detail?id= 3342]

What you are attempting is to remove the a=ssrc lines before calling setLocalDescription. 您要尝试的是在调用setLocalDescription之前删除a = ssrc行。 This is probably not going to work. 这可能行不通。 If you want to simulate the scenario try removing them before calling setRemoteDescription with the SDP. 如果要模拟场景,请尝试在使用SDP调用setRemoteDescription之前将其删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM