Search in sources :

Example 1 with FadeAudio

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

the class FFHelper method fade1.

/**
 * @param inFile
 * @param outFile
 * @param fadeType
 * @param duration
 * @throws IOException
 */
public static void fade1(File inFile, File outFile, FadeType fadeType, Duration duration) throws IOException {
    FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
    builder.addMediaInputFile(inFile);
    FadeVideo fadeVideo = FadeVideo.build().type(fadeType).startTime(Time.valueOf(0)).duration(duration);
    FadeAudio fadeAudio = FadeAudio.build().type(fadeType).startTime(Time.valueOf(0)).duration(duration);
    builder.filter(fadeVideo).filter(fadeAudio);
    builder.addMediaOutputFile(outFile).overwrite();
    FFExecutor<Object> executor = builder.build();
    executor.execute();
}
Also used : FadeVideo(org.fagu.fmv.ffmpeg.filter.impl.FadeVideo) FadeAudio(org.fagu.fmv.ffmpeg.filter.impl.FadeAudio) FFMPEGExecutorBuilder(org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)

Aggregations

FFMPEGExecutorBuilder (org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)1 FadeAudio (org.fagu.fmv.ffmpeg.filter.impl.FadeAudio)1 FadeVideo (org.fagu.fmv.ffmpeg.filter.impl.FadeVideo)1