Kurento录制文件大小为0,为什么呢

时间:2017-05-02 11:12:59

标签: webrtc kurento

为什么录音文件大小为0.

-rw-r--r--  1 kurento kurento    0 May  2 02:27 recorder1.webm  
-rw-r--r--  1 kurento kurento    0 May  2 02:27 recorder2.webm  

音频流如下。

           ------>recorderEndpointA  
          |  
Peer A <--------->RtpEndpointA<==>RtpEndpointB<---------->Peer B  
                       |  
                       --->recorderEndpointB  

程序如下 - 创建mediapipeline
- 创建两个RtpEndpoints
- RtpEndpointA连接RtpEndpointB
- RtpEndpointB连接RtpEndpointA
- 创建两个RecorderEndpoints
- RtpEndpointA连接RecorderEndpointA
- RtpEndpointB连接RecorderEndpointB
- RecorderEndpointA记录
- RecorderEndpointB记录

因此,谈话是正常的,但录制文件大小为0。

服务器日志如下。

2017-05-02 02:27:32,241406 1872 [0x00007f60cd89d700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:422 processMessage()  Message: >{"id":"7","jsonrpc":"2.0","method":"invoke","params":{"object":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint","operation":"connect","operationParams":{"sink":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint"},"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba"}}  

<  

2017-05-02 02:27:32,242313 1872 [0x00007f60cd89d700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint params AUDIO default default  

2017-05-02 02:27:32,243147 1872 [0x00007f60cd89d700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint params VIDEO default default  

2017-05-02 02:27:32,244064 1872 [0x00007f60cd89d700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint params DATA default default  

2017-05-02 02:27:32,244852 1872 [0x00007f60cd89d700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:424 processMessage()  Response: >{"id":"7","jsonrpc":"2.0","result":{"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba","value":null}}  

<  

2017-05-02 02:27:33,241751 1872 [0x00007f60cd09c700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:422 processMessage()  Message: >{"id":"8","jsonrpc":"2.0","method":"invoke","params":{"object":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint","operation":"connect","operationParams":{"sink":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint"},"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba"}}  

< 

2017-05-02 02:27:33,242461 1872 [0x00007f60cd09c700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint params AUDIO default default  

2017-05-02 02:27:33,245165 1872 [0x00007f60cd09c700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint params VIDEO default default 

2017-05-02 02:27:33,246502 1872 [0x00007f60cd09c700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint params DATA default default  

2017-05-02 02:27:33,248380 1872 [0x00007f60cd09c700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:424 processMessage()  Response: >{"id":"8","jsonrpc":"2.0","result":{"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba","value":null}}  

<  

2017-05-02 02:27:33,257375 1872 [0x00007f60a9523700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:492 mediaFlowInStateChange() <kmsrtpendpoint32>  Media Flowing IN in pad default with type audio  

2017-05-02 02:27:34,244614 1872 [0x00007f60cd89d700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:422 processMessage()  Message: >{"id":"9","jsonrpc":"2.0","method":"create","params":{"constructorParams":{"mediaPipeline":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline","profile":7,"stopOnEndOfStream":true,"uri":"file:///tmp/recorder1.webm"},"properties":null,"type":"RecorderEndpoint"}}  

<  

2017-05-02 02:27:34,248876 1872 [0x00007f60cd89d700]    info KurentoRecorderEndpointImpl RecorderEndpointImpl.cpp:83 RecorderEndpointImpl()  Set WEBM profile  

2017-05-02 02:27:34,249882 1872 [0x00007f60cd89d700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:424 processMessage()  Response: >{"id":"9","jsonrpc":"2.0","result":{"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba","value":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/2dc7538e-f77b-44c0-90eb-4ea635298eb9_kurento.RecorderEndpoint"}}  

< 

2017-05-02 02:27:34,295687 1872 [0x00007f60a37fe700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:447 mediaFlowOutStateChange() <kmsrtpendpoint32>  Media Flowing OUT in pad default with type audio  

2017-05-02 02:27:34,297274 1872 [0x00007f60aa742700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:492 mediaFlowInStateChange() <kmsrtpendpoint33>  Media Flowing IN in pad default with type audio  

2017-05-02 02:27:35,244376 1872 [0x00007f60cd09c700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:422 processMessage()  Message: >{"id":"10","jsonrpc":"2.0","method":"create","params":{"constructorParams":{"mediaPipeline":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline","profile":7,"stopOnEndOfStream":true,"uri":"file:///tmp/recorder2.webm"},"properties":null,"type":"RecorderEndpoint"}}  

< 

2017-05-02 02:27:35,250939 1872 [0x00007f60cd09c700]    info KurentoRecorderEndpointImpl RecorderEndpointImpl.cpp:83 RecorderEndpointImpl()  Set WEBM profile  

2017-05-02 02:27:35,252356 1872 [0x00007f60cd09c700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:424 processMessage()  Response: >{"id":"10","jsonrpc":"2.0","result":{"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba","value":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/eba7c283-34d5-43a1-8cd2-5892ecaddb53_kurento.RecorderEndpoint"}}  

< 

2017-05-02 02:27:36,244544 1872 [0x00007f60cd89d700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:422 processMessage()  Message: >{"id":"11","jsonrpc":"2.0","method":"invoke","params":{"object":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint","operation":"connect","operationParams":{"sink":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/2dc7538e-f77b-44c0-90eb-4ea635298eb9_kurento.RecorderEndpoint"},"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba"}}  

<  

2017-05-02 02:27:36,247151 1872 [0x00007f60cd89d700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/2dc7538e-f77b-44c0-90eb-4ea635298eb9_kurento.RecorderEndpoint params AUDIO default default 

2017-05-02 02:27:36,247927 1872 [0x00007f60cd89d700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/2dc7538e-f77b-44c0-90eb-4ea635298eb9_kurento.RecorderEndpoint params VIDEO default default  

2017-05-02 02:27:36,248536 1872 [0x00007f60cd89d700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/bec7d747-2772-49b4-8353-fe5346a15358_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/2dc7538e-f77b-44c0-90eb-4ea635298eb9_kurento.RecorderEndpoint params DATA default default  

2017-05-02 02:27:36,249189 1872 [0x00007f60cd89d700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:424 processMessage()  Response: >{"id":"11","jsonrpc":"2.0","result":{"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba","value":null}}  

<  

2017-05-02 02:27:37,244760 1872 [0x00007f60cd09c700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:422 processMessage()  Message: >{"id":"12","jsonrpc":"2.0","method":"invoke","params":{"object":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint","operation":"connect","operationParams":{"sink":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/eba7c283-34d5-43a1-8cd2-5892ecaddb53_kurento.RecorderEndpoint"},"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba"}} 

<  

2017-05-02 02:27:37,245968 1872 [0x00007f60cd09c700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/eba7c283-34d5-43a1-8cd2-5892ecaddb53_kurento.RecorderEndpoint params AUDIO default default  

2017-05-02 02:27:37,246712 1872 [0x00007f60cd09c700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/eba7c283-34d5-43a1-8cd2-5892ecaddb53_kurento.RecorderEndpoint params VIDEO default default  

2017-05-02 02:27:37,247314 1872 [0x00007f60cd09c700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:867 connect()  Connecting ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/f7fa31b4-abdd-4da0-99f2-dcc590cc17fc_kurento.RtpEndpoint -> ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/eba7c283-34d5-43a1-8cd2-5892ecaddb53_kurento.RecorderEndpoint params DATA default default  

2017-05-02 02:27:37,247905 1872 [0x00007f60cd09c700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:424 processMessage()  Response: >{"id":"12","jsonrpc":"2.0","result":{"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba","value":null}}  

<  

2017-05-02 02:27:38,245166 1872 [0x00007f60cd89d700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:422 processMessage()  Message: >{"id":"13","jsonrpc":"2.0","method":"invoke","params":{"object":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/2dc7538e-f77b-44c0-90eb-4ea635298eb9_kurento.RecorderEndpoint","operation":"record","sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba"}}  

< 

2017-05-02 02:27:38,303222 1872 [0x00007f60cd89d700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:424 processMessage()  Response: >{"id":"13","jsonrpc":"2.0","result":{"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba","value":null}}  

< 

2017-05-02 02:27:38,312409 1872 [0x00007f60a07f8700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:492 mediaFlowInStateChange() <kmsrecorderendpoint28>  Media Flowing IN in pad default with type audio  

2017-05-02 02:27:39,245340 1872 [0x00007f60cd09c700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:422 processMessage()  Message: >{"id":"14","jsonrpc":"2.0","method":"invoke","params":{"object":"ea2cfde5-7904-4991-bacb-f66440ef194b_kurento.MediaPipeline/eba7c283-34d5-43a1-8cd2-5892ecaddb53_kurento.RecorderEndpoint","operation":"record","sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba"}}  

<  

2017-05-02 02:27:39,294527 1872 [0x00007f60cd09c700]   debug KurentoWebSocketTransport WebSocketTransport.cpp:424 processMessage()  Response: >{"id":"14","jsonrpc":"2.0","result":{"sessionId":"7f751217-ef13-4a92-bf50-48a424bcdaba","value":null}}  

< 

2017-05-02 02:27:39,309717 1872 [0x00007f60a0ff9700]   debug KurentoMediaElementImpl   MediaElementImpl.cpp:492 mediaFlowInStateChange() <kmsrecorderendpoint29>  Media Flowing IN in pad default with type audio  

3 个答案:

答案 0 :(得分:2)

我在这里发布了一个答案,其他任何人都在这里发誓想知道发生了什么。 非常重要,RecorderEndpoint知道正在使用的媒体容器配置文件。我的问题是我在开发时关闭了前端媒体限制的音频。 RecorderEndpoint需要通过传递正确的MediaProfileSpecType来了解这一点。

this.recorder = new RecorderEndpoint.Builder(pipeline, RECORDING_PATH + roomName + '_' + name + RECORDING_EXT)
  .withMediaProfile(MediaProfileSpecType.WEBM)
  .build();

只需返回前端的音频即可修复它,但您也可以参考Kurento团队根据某种媒体约束容器逻辑连接的其他教程中包含的代码。

答案 1 :(得分:1)

谢谢大家。 Kurento仅作为音频媒体服务器。当我创建recordEndpointer时,未设置mediaProfile。但是,mediaProfile应设置为“WEBM_AUDIO_ONLY”。现在它可以工作。

答案 2 :(得分:0)

我们一直在使用Kurento在Pipe的Chrome中为WebRTC视频录制提供支持。

我们也遇到了0字节视频录制问题。到目前为止,我们已经确定了两个原因:

  1. TURN / STUN协议被某些VPN阻止,例如TunnelBear(因为this),因此没有为用户找到ICE候选者。我们的第一个测试版没有考虑到这一点。
  2. 用户无需与Chrome的允许/阻止相机权限对话框进行交互即可开始录制。