use of org.fagu.fmv.ffmpeg.filter.impl.Boxblur in project fmv by f-agu.
the class FFHelper method backgroundBlurOverlayScale.
/**
* @param inFile
* @param outFile
* @throws IOException
*/
public static void backgroundBlurOverlayScale(File inFile, File outFile) throws IOException {
FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
// inFile is in HD720
InputProcessor inputProcessor = builder.addMediaInputFile(inFile);
// builder.filter(FilterComplex.create(AudioGenerator.build().silence()));
Boxblur boxblur = Boxblur.build().lumaRadius("8").lumaPower(8);
Hue hue = Hue.build().blackAndWhite();
FilterComplex blurAndBW = FilterComplex.create(boxblur, hue).addInput(inputProcessor);
FilterComplex scale = FilterComplex.create(Scale.build().size(Size.HD480)).addInput(inputProcessor);
Overlay overlay = Overlay.with(blurAndBW, scale).shortest(true).positionMiddle();
FilterComplex scale2 = FilterComplex.create(Scale.build().size(Size.HD480)).addInput(overlay);
builder.filter(scale2);
builder.addMediaOutputFile(outFile).overwrite();
FFExecutor<Object> executor = builder.build();
executor.execute();
}
Aggregations