2014-12-23 47 views
2

我使用kurento录制的视频流服务器磁盘被叫流。我遵循kurento tutorial here 的更改,其中node.js中的教程hello-world更改为将流记录到磁盘。 现在我想要做的是更改tutorial4 one-to-one call以将来电者和被叫者流记录为2个文件。Kurento记录呼叫者和node.js中

当我将kurento记录下来时,记录器与管道相连。管道是两个对等体之间连接的表示。 如何在管道中记录单个对等体的流,这两个流分别都是来自哪个调用者和被调用者之一?

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

回答

11

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

对于您的具体问题,RecorerEndpoint只是媒体元素,能够将文件流作为输入提供给文件。这意味着您可以将RecorderEndpoint连接到任何其他源元素。举例来说,如果你有两个同龄人之间的B2B呼叫,每个节点都将有相关的WebRtcEndpoint使得所得到的管道将是这样的:

Peer A <--------->webRtcEndpointA<==>webRtcEndpointB<---------->Peer B 

用于记录从节点A和同伴B都来的流,你只需要创建两个RecorderEndpoints并适当地连接起来,使最终的管道是一样的东西:

       ------>recorderEndpointA 
          | 
Peer A <--------->webRtcEndpointA<==>webRtcEndpointB<---------->Peer B 
             | 
             --->recorderEndpointB 

这个源代码应包括:(我ommit样板代码,你已经在你举教程):

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();