Search in sources :

Example 1 with Boxblur

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();
}
Also used : FilterComplex(org.fagu.fmv.ffmpeg.filter.FilterComplex) FFMPEGExecutorBuilder(org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder) Hue(org.fagu.fmv.ffmpeg.filter.impl.Hue) InputProcessor(org.fagu.fmv.ffmpeg.operation.InputProcessor) Boxblur(org.fagu.fmv.ffmpeg.filter.impl.Boxblur) Overlay(org.fagu.fmv.ffmpeg.filter.impl.Overlay)

Aggregations

FFMPEGExecutorBuilder (org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)1 FilterComplex (org.fagu.fmv.ffmpeg.filter.FilterComplex)1 Boxblur (org.fagu.fmv.ffmpeg.filter.impl.Boxblur)1 Hue (org.fagu.fmv.ffmpeg.filter.impl.Hue)1 Overlay (org.fagu.fmv.ffmpeg.filter.impl.Overlay)1 InputProcessor (org.fagu.fmv.ffmpeg.operation.InputProcessor)1