Kurento在node.js中记录调用者和被调用者流

Man*_*ndi 2 record node.js webrtc kurento

我正在使用kurento将流记录到服务器磁盘.我在这里更改了kurento教程, 其中更改了node.js中的教程hello-world以将流记录到磁盘.现在我要做的是更改tutorial4一对一调用以将调用者和被调用者流记录到2个文件.

正如我在kurento中所说,录音机与管道相连.管道是两个对等体之间连接的表示.如何在管道中记录单个对等体的流,分别是一个调用者和一个被调用者的流?

我尝试了很多,但找不到溶剂.

lul*_*lop 11

也许你应该阅读基本的Kurento文档,介绍什么是媒体元素,以及什么是管道,以便更清晰地了解Kurento的API如何工作.

对于您的具体问题,RecorerEndpoint只是能够将提供的流作为输入记录到文件的媒体元素.这意味着您可以将RecorderEndpoint连接到任何其他源元素.例如,如果您在两个对等体之间进行B2B调用,则每个对等体都将关联一个WebRtcEndpoint,以便生成的管道将是这样的:

Peer A <--------->webRtcEndpointA<==>webRtcEndpointB<---------->Peer B
Run Code Online (Sandbox Code Playgroud)

要记录来自对等A和对等B的流,您只需要创建两个RecorderEndpoints并适当地连接它们,以便最终的管道类似于:

                             ------>recorderEndpointA
                             |
 Peer A <--------->webRtcEndpointA<==>webRtcEndpointB<---------->Peer B
                                        |
                                        --->recorderEndpointB
Run Code Online (Sandbox Code Playgroud)

这个的源代码应该包括(我省略了你在引用的教程中已经有的样板代码):

pipeline.create('RecorderEndpoint', {uri: "file:///tmp/fileA.webm"}, function(error, recorderEndpointA ...
...
webRtcEndpointA.connect(recorderEndpointA);
recorderEndpointA.record();

pipeline.create('RecorderEndpoint', {uri: "file:///tmp/fileB.webm"}, function(error, recoderEndpointB ...
...
webRtcEndpointB.connect(recorderEndpointB);
recorderEndpointB.record();
Run Code Online (Sandbox Code Playgroud)