本文介绍了Kurento录音文件大小为0,为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Why the recording file size is 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

流程如下.
- 创建媒体管道
- 创建两个 RtpEndpoints
- RtpEndpointA 连接 RtpEndpointB
- RtpEndpointB 连接 RtpEndpointA
- 创建两个 RecorderEndpoints
- RtpEndpointA 连接 RecorderEndpointA
- RtpEndpointB 连接 RecorderEndpointB
- RecorderEndpointA 记录
- RecorderEndpointB 记录

The procedure is as follows.
- Create mediapipeline
- Create two RtpEndpoints
- RtpEndpointA connects RtpEndpointB
- RtpEndpointB connects RtpEndpointA
- Create two RecorderEndpoints
- RtpEndpointA connects RecorderEndpointA
- RtpEndpointB connects RecorderEndpointB
- RecorderEndpointA record
- RecorderEndpointB record

结果,通话正常,但录音文件大小为0.

As a result, talk is normal, but recording file size is 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

推荐答案

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

I'm posting an answer here in the case anyone else winds up here wondering what's going on. It is VERY IMPORTANT that the RecorderEndpoint is aware of what media container profile that is being used. My problem was that I had audio turned off on the front end media constraints while developing. The RecorderEndpoint needs to be aware of this by you passing in the correct MediaProfileSpecType.

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

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

Simply turning back on audio on the front end fixed it, but you can also reference code contained in the other tutorials where the Kurento team has connecting according to some sort of media constraint container logic.

这篇关于Kurento录音文件大小为0,为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 07:29