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字节“。