2017-06-27 51 views
0

我正在尝试使用一对一w/Recording演示作为参考编写多对多演示的代码。我已经添加以下代码到UserSession.java构造:Kurento多对多录制空白视频

public static final String RECORDING_PATH = "file:///recordings/"; 
    public static final String RECORDING_EXT = ".webm"; 

    public UserSession(final String name, String roomName, final WebSocketSession session, MediaPipeline pipeline) { 
    this.pipeline = pipeline; 
    this.name = name; 
    this.session = session; 
    this.roomName = roomName; 

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

    this.isRecording = false; 

而且我已将此添加到getEndpointForUser方法的底部进入的介质连接到会议的同行后:

sender.getOutgoingWebRtcPeer().connect(incoming); 
sender.getOutgoingWebRtcPeer().connect(this.recorder); 

我使用套接字调用手动触发记录并停止录制,但视频文件始终为空(0kb)。为每个会话创建正确数量的视频,但他们没有任何数据。有谁知道我可能做错了什么?

回答

0

它是非常重要 RecorderEndpoint知道正在使用哪个媒体容器约束配置文件。我的问题是,在开发时(有点令人讨厌),我在前端媒体约束下关闭了音频。 RecorderEndpoint需要通过传递正确的MediaProfileSpecType来了解这一点。

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

要找前端音频义无反顾固定它,但你也可以参考包含在有Kurento队是根据某些媒体的约束容器的逻辑,连接RecorderEndpoint其他教程代码,您将可能需要在生产应用程序的人有网络摄像头问题,其中音频或视频不通过。