【发布时间】:2015-10-04 23:00:00
【问题描述】:
我可以使用 Kurento 媒体服务器录制视频+音频。我在录制纯音频流时遇到问题。从How to use kurento-media-server for audio only stream? 了解到必须修改答案 SDP。
目前我正在向 PeerConnection 添加只有音轨的 MediaStream。在服务器端发回答案 SDP 之前,我对其进行了修改。我尝试删除
- 以下任何内容(包括)
m=video - 以下任何内容(包括)
a=mid:video
在这两种情况下,浏览器端 PeerConnection#signalingState 都停留在 have-local-offer。
在媒体流将开始流动并且 Kurento 将开始录制纯音频流的答案 SDP 中有何更改?
这是来自 WebRtcEndpoint#processoffer 的原始答案 SDP(删除的来源):
v=0
o=- 7750769884654864002 0 IN IP4 0.0.0.0
s=Kurento Media Server
c=IN IP4 0.0.0.0
t=0 0
a=group:BUNDLE audio video
m=audio 40192 RTP/SAVPF 111 0
c=IN IP4 10.0.2.15
a=rtpmap:111 opus/48000/2
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:40192 IN IP4 10.0.2.15
a=rtcp-mux
a=ssrc:4125152746 cname:user2534372120@host-b735c5b0
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=mid:audio
a=ice-ufrag:SEV7
a=ice-pwd:BQyTSM0hvTJeqykFZovuBS
a=fingerprint:sha-256 E4:A1:25:2C:53:60:28:F5:C1:94:C6:32:E0:13:81:06:A6:66:77:00:52:C2:D9:93:AF:E4:A0:B3:4D:5C:9C:C3
a=candidate:1 1 UDP 2013266431 10.0.2.15 40192 typ host
a=candidate:2 1 UDP 2013266431 192.168.33.10 44816 typ host
m=video 40192 RTP/SAVPF 100
c=IN IP4 10.0.2.15
b=AS:500
a=rtpmap:100 VP8/90000
a=sendonly
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp:40192 IN IP4 10.0.2.15
a=rtcp-mux
a=ssrc:1769273725 cname:user2534372120@host-b735c5b0
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=mid:video
a=ice-ufrag:SEV7
a=ice-pwd:BQyTSM0hvTJeqykFZovuBS
a=fingerprint:sha-256 E4:A1:25:2C:53:60:28:F5:C1:94:C6:32:E0:13:81:06:A6:66:77:00:52:C2:D9:93:AF:E4:A0:B3:4D:5C:9C:C3
a=candidate:1 1 UDP 2013266431 10.0.2.15 40192 typ host
a=candidate:2 1 UDP 2013266431 192.168.33.10 44816 typ host
编辑:
根据 kurento google 小组的建议,似乎没有必要修改 SDP。至少使用 Kurento 6。 我得到了纯音频工作(来自浏览器的纯音频媒体流和来自浏览器的音频+视频媒体流)。为此(Ruby 中的示例代码):
- 在 RecorderEndpoint builder
RecorderEndpoint::Builder.new(@pipeline, location).withMediaProfile(org.kurento.client.MediaProfileSpecType::WEBM_AUDIO_ONLY).build()中指定 MediaProfileSpecType - 连接记录器端点时指定MediaType(@source 是WebRtcEndpoint):
@source.connect(@recorder, org.kurento.client.MediaType::AUDIO)
【问题讨论】: