2017-06-27 54 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其他教程代碼,您將可能需要在生產應用程序的人有網絡攝像頭問題,其中音頻或視頻不通過。