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());