Kurento在node.js中logging调用者和被调用者stream

我正在使用kurento将streamlogging到服务器磁盘。 我跟着kurento教程的变化,在这里 node.js中的教程hello-world被改变,将streamlogging到磁盘。 现在我想要做的是改变tutorial4一对一的调用来logging调用者和被调用者stream到2个文件。

当我把kurentologging下来的时候,logging器就和pipe道相连接了。 stream水线是两个对等体之间连接的表示。 我怎样才能loggingpipe道中的单个对等的stream,分别是stream的一个调用者和被调用者之一?

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

也许你应该阅读基本的Kurento文档,介绍什么是媒体元素,什么是pipe道,以更清晰地展示Kurento的API如何工作。

RecorerEndpoint是一个媒体元素,可以将文件input到文件中。 这意味着您可以将RecorderEndpoint连接到任何其他源元素。 例如,如果您在两个对等方之间进行了B2B调用,则每个对等方都将关联一个WebRtcEndpoint,以便生成的pipe道将如下所示:

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

为了logging来自Peer A和Peer B的数据stream,你只需要创build两个RecorderEndpoint并适当地连接它们,这样最终的stream水线就像这样:

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

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

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