Search in sources :

Example 1 with Delogo

use of org.fagu.fmv.ffmpeg.filter.impl.Delogo in project fmv by f-agu.

the class Reducer method reduce.

public void reduce(File srcFile, File destFile, Logo logo) throws IOException {
    int crf = (int) (getCRF(srcFile).orElse(26));
    FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
    builder.hideBanner();
    builder.addMediaInputFile(srcFile);
    if (logo != null) {
        Delogo delogo = logo.generateFilter().show(true);
        builder.filter(delogo);
    }
    OutputProcessor outputProcessor = builder.addMediaOutputFile(destFile);
    outputProcessor.qualityScale(0);
    outputProcessor.duration(Duration.valueOf(60));
    outputProcessor.codec(H264.findRecommanded().strict(Strict.EXPERIMENTAL).quality(crf));
    outputProcessor.overwrite();
    FFExecutor<Object> executor = builder.build();
    executor.execute();
}
Also used : FFMPEGExecutorBuilder(org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder) Delogo(org.fagu.fmv.ffmpeg.filter.impl.Delogo) OutputProcessor(org.fagu.fmv.ffmpeg.operation.OutputProcessor)

Aggregations

FFMPEGExecutorBuilder (org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)1 Delogo (org.fagu.fmv.ffmpeg.filter.impl.Delogo)1 OutputProcessor (org.fagu.fmv.ffmpeg.operation.OutputProcessor)1