Search in sources :

Example 1 with AudioModifier

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

the class FFHelper method audioHalfVolume.

/**
 * @param inFile
 * @param outFile
 * @throws IOException
 */
public static void audioHalfVolume(File inFile, File outFile) throws IOException {
    FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
    InputProcessor inputProcessor = builder.addMediaInputFile(inFile);
    AudioModifier audioModifier = AudioModifier.build().halfVolume().channelLayout(ChannelLayout.SAME);
    FilterComplex filtercomplex = FilterComplex.create(audioModifier);
    filtercomplex.addInput(inputProcessor);
    builder.filter(filtercomplex);
    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) InputProcessor(org.fagu.fmv.ffmpeg.operation.InputProcessor) AudioModifier(org.fagu.fmv.ffmpeg.filter.impl.AudioModifier)

Aggregations

FFMPEGExecutorBuilder (org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)1 FilterComplex (org.fagu.fmv.ffmpeg.filter.FilterComplex)1 AudioModifier (org.fagu.fmv.ffmpeg.filter.impl.AudioModifier)1 InputProcessor (org.fagu.fmv.ffmpeg.operation.InputProcessor)1