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