0
我想爲每個參與者記錄每個參與者視頻流或者單獨的文件,或者如果使用複合視頻獲取單個視頻,那將會非常好。如何在Kurento組呼叫中實現錄音?
我已經加入我的UserSession.java代碼如下:
public UserSession(final String name, String roomName, finalWebSocketSession session, MediaPipeline pipeline) {
this.pipeline = pipeline;
this.name = name;
this.session = session;
this.roomName = roomName;
this.outgoingMedia = new WebRtcEndpoint.Builder(pipeline).build();
this.outgoingMedia.connect(this.outgoingMedia);
this.outgoingMedia.addIceCandidateFoundListener(newEventListener<IceCandidateFoundEvent>() {
@Override
public void onEvent(IceCandidateFoundEvent event) {
JsonObject response = new JsonObject();
response.addProperty("id", "iceCandidate");
response.addProperty("name", name);
response.add("candidate",JsonUtils.toJsonObject(event.getCandidate()));
try {
synchronized (session) {
session.sendMessage(new TextMessage(response.toString()));
}
} catch (IOException e) {
log.debug(e.getMessage());
}
}
});
this.composite = new Composite.Builder(pipeline).build();
this.hubPort = new HubPort.Builder(this.composite).build();
this.outgoingMedia.connect(hubPort);
this.recorder = new RecorderEndpoint.Builder(composite.getMediaPipeline(), "file:///home/vikram/Videos/9/"+this.roomName+"/"+this.name+".webm").build();
try{
recorder.record();
}catch(Exception e){
e.printStackTrace();
}
}
WebM的文件獲得創建爲每一個參加者,但大小爲0字節「。