Package com.kurento.kmf.media

Examples of com.kurento.kmf.media.PlateDetectorFilter$Builder


        crowdDetector.connect(httpEP);
      }

      else if (contentId != null && contentId.equalsIgnoreCase("plate")) {
        // Plate Detector Filter
        PlateDetectorFilter plateDetectorFilter = mp
            .newPlateDetectorFilter().build();
        playerEndpoint.connect(plateDetectorFilter);
        plateDetectorFilter.connect(httpEP);
        session.setAttribute("plateValue", "");
        plateDetectorFilter
            .addPlateDetectedListener(new MediaEventListener<PlateDetectedEvent>() {
              @Override
              public void onEvent(PlateDetectedEvent event) {
                if (session.getAttribute("plateValue")
                    .toString().equals(event.getPlate())) {
View Full Code Here


    MediaPipeline mp = pipelineFactory.create();
    PlayerEndpoint playerEP = mp.newPlayerEndpoint(
        "http://files.kurento.org/video/plates.webm").build();
    HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
        .build();
    PlateDetectorFilter plateDetectorFilter = mp.newPlateDetectorFilter()
        .build();
    playerEP.connect(plateDetectorFilter);
    plateDetectorFilter.connect(httpEP);
    plateDetectorFilter.setPlateWidthPercentage((float) 0.3);

    final List<EndOfStreamEvent> eosEvents = new ArrayList<>();
    playerEP.addEndOfStreamListener(new MediaEventListener<EndOfStreamEvent>() {
      @Override
      public void onEvent(EndOfStreamEvent event) {
        eosEvents.add(event);
      }
    });

    final List<String> platesDetectedEvents = new ArrayList<>();
    plateDetectorFilter
        .addPlateDetectedListener(new MediaEventListener<PlateDetectedEvent>() {
          @Override
          public void onEvent(PlateDetectedEvent event) {
            log.info("Plate Detected {}", event.getPlate());
            platesDetectedEvents.add(event.getPlate());
View Full Code Here

      throws Exception {
    MediaPipeline mp = session.getMediaPipelineFactory().create();
    session.releaseOnTerminate(mp);

    WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
    PlateDetectorFilter plateDetectorFilter = mp.newPlateDetectorFilter()
        .build();
    session.setAttribute("plateValue", "");
    plateDetectorFilter
        .addPlateDetectedListener(new MediaEventListener<PlateDetectedEvent>() {
          @Override
          public void onEvent(PlateDetectedEvent event) {
            getLogger().info("Plate detected {}", event);
            if (session.getAttribute("plateValue").toString()
                .equals(event.getPlate())) {
              return;
            }
            session.setAttribute("plateValue", event.getPlate());
            session.publishEvent(new ContentEvent(event.getType(),
                event.getPlate()));
          }
        });

    webRtcEndpoint.connect(plateDetectorFilter);
    plateDetectorFilter.connect(webRtcEndpoint);

    session.start(webRtcEndpoint);
  }
View Full Code Here

TOP

Related Classes of com.kurento.kmf.media.PlateDetectorFilter$Builder

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.