Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.FaceOverlayFilter


        "http://files.kurento.org/video/fiwarecut.mp4").build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    RecorderEndpoint recorderEP = mp.newRecorderEndpoint(
        FILE_SCHEMA + getDefaultFileForRecording()).build();
    final FaceOverlayFilter filter = mp.newFaceOverlayFilter().build();
    filter.setOverlayedImage(
        "http://files.kurento.org/imgs/mario-wings.png", -0.2F, -1.2F,
        1.6F, 1.6F);

    playerEP.connect(filter);
    filter.connect(httpEP);
    filter.connect(recorderEP);

    // Test execution #1. Play and record
    launchBrowser(browserType, httpEP, playerEP, recorderEP);

    // Media Pipeline #2
View Full Code Here


    // System.out.println("Finish");
    // System.exit(0);
    // }
    // });

    FaceOverlayFilter filter = pipeline.newFaceOverlayFilter().build();
    filter.setOverlayedImage(
        "http://files.kurento.org/imgs/mario-wings.png", -0.35F, -1.2F,
        1.6F, 1.6F);

    HttpGetEndpoint recorder = pipeline.newHttpGetEndpoint().build();

    // RecorderEndpoint recorder = pipeline.newRecorderEndpoint(
    // "file:///home/mica/Data/Kurento/tmp/video.mp4").build();

    player.connect(filter);
    filter.connect(recorder);

    player.play();

    Desktop.getDesktop().browse(new URI(recorder.getUrl()));
View Full Code Here

    // Media Elements: WebRTC Endpoint, Filter
    final WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    final PointerDetectorFilter pointerDetectorFilter = mp
        .newPointerDetectorFilter().build();
    final FaceOverlayFilter faceOverlayFilter = mp.newFaceOverlayFilter()
        .build();
    PointerDetectorWindowMediaParam start = new PointerDetectorWindowMediaParam(
        "start", 100, 100, 280, 380);
    start.setImage("http://files.kurento.org/imgs/start.png");
    pointerDetectorFilter.addWindow(start);
    pointerDetectorFilter
        .addWindowInListener(new MediaEventListener<WindowInEvent>() {
          public void onEvent(WindowInEvent event) {
            // Set overlay image
            faceOverlayFilter.setOverlayedImage(
                "http://files.kurento.org/imgs/mario-wings.png",
                -0.35F, -1.2F, 1.6F, 1.6F);
          }
        });

    // Connections
    webRtcEndpoint.connect(pointerDetectorFilter);
    pointerDetectorFilter.connect(faceOverlayFilter);
    faceOverlayFilter.connect(webRtcEndpoint);

    // Start content session
    contentSession.start(webRtcEndpoint);
  }
View Full Code Here

  public void onContentRequest(WebRtcContentSession contentSession)
      throws Exception {
    MediaPipeline mp = contentSession.getMediaPipelineFactory().create();
    contentSession.releaseOnTerminate(mp);

    FaceOverlayFilter filter = mp.newFaceOverlayFilter().build();
    filter.setOverlayedImage(
        "http://files.kurento.org/imgs/mario-wings.png", -0.35F, -1.2F,
        1.6F, 1.6F);

    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    webRtcEndpoint.connect(filter);
    filter.connect(webRtcEndpoint);
    contentSession.start(webRtcEndpoint);
  }
View Full Code Here

    log.debug("Received SDP offer");

    // Media Logic
    MediaPipeline mp = mpf.create();
    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    FaceOverlayFilter faceOverlayFilter = mp.newFaceOverlayFilter().build();
    faceOverlayFilter.setOverlayedImage(
        "http://files.kurento.org/imgs/mario-wings.png", -0.35F, -1.2F,
        1.6F, 1.6F);
    webRtcEndpoint.connect(faceOverlayFilter);
    faceOverlayFilter.connect(webRtcEndpoint);

    // SDP Answer
    String sdpAnswer = webRtcEndpoint.processOffer(sdpOffer);
    JsonObject scParams = new JsonObject();
    scParams.addProperty("sdpAnswer", sdpAnswer);
View Full Code Here

TOP

Related Classes of com.kurento.kmf.media.FaceOverlayFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.