1

这是我使用java创建复合视频录制的代码。但它会创建空白视频。不播放流。为什么?

mp       = kurento.createMediaPipeline();

WebRtcEndpoint webRtcEPRed = new WebRtcEndpoint.Builder(mp).build();
WebRtcEndpoint webRtcEPGreen = new WebRtcEndpoint.Builder(mp).build();

Composite composite = new Composite.Builder(mp).build();
HubPort hubPort1 = new HubPort.Builder(composite).build();
HubPort hubPort2 = new HubPort.Builder(composite).build();
HubPort hubPort3 = new HubPort.Builder(composite).build();

RecorderEndpoint recorderEP =
    new RecorderEndpoint.Builder(mp, RECORDING_PATH + "twoside" + RECORDING_EXT).build();


webRtcEPRed.connect(hubPort1);
webRtcEPGreen.connect(hubPort2);

hubPort3.connect(recorderEP);

recorderEP.record();
4

1 回答 1

1

我将我的代码更改如下,现在它工作正常

  // Media pipeline
    pipeline = kurento.createMediaPipeline();


    Composite composite = new Composite.Builder(pipeline).build();

    HubPort hubPort1 = new HubPort.Builder(composite).build();
    HubPort hubPort2 = new HubPort.Builder(composite).build();
    HubPort hubPort3 = new HubPort.Builder(composite).build();

    recorderEP =  new RecorderEndpoint.Builder(pipeline, RECORDING_PATH + "twosidess" + RECORDING_EXT).build();

    webRtcCaller.connect(webRtcCallee);
    webRtcCaller.connect(recorderEP);

    webRtcCaller.connect(hubPort1);
    webRtcCallee.connect(hubPort2);

    webRtcCallee.connect(webRtcCaller);

    hubPort3.connect(recorderEP);
    recorderEP.record();
于 2016-01-18T04:57:58.197 回答