Search in sources :

Example 1 with Speed

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

the class FFHelper method speed.

/**
 * @param inFile
 * @param outFile
 * @param multiplyBy
 * @throws IOException
 */
public static void speed(File inFile, File outFile, float multiplyBy) throws IOException {
    FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
    InputProcessor inputProcessor = builder.addMediaInputFile(inFile);
    Speed speed = Speed.multiply(multiplyBy);
    speed.addInput(inputProcessor);
    builder.filter(speed);
    builder.addMediaOutputFile(outFile).overwrite();
    FFExecutor<Object> executor = builder.build();
    executor.execute();
}
Also used : Speed(org.fagu.fmv.ffmpeg.filter.impl.Speed) FFMPEGExecutorBuilder(org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder) InputProcessor(org.fagu.fmv.ffmpeg.operation.InputProcessor)

Example 2 with Speed

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

the class SpeedExecutable method populateWithIdentifiables.

/**
 * @see org.fagu.fmv.core.exec.executable.GenericExecutable#populateWithIdentifiables(java.io.File,
 *      org.fagu.fmv.core.exec.FileCache.Cache, org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)
 */
@Override
protected List<FilterInput> populateWithIdentifiables(File toFile, Cache cache, FFMPEGExecutorBuilder builder) {
    List<FilterInput> filterInputs = super.populateWithIdentifiables(toFile, cache, builder);
    if (filterInputs.size() != 1) {
        throw new RuntimeException("For speed, only one input: " + filterInputs);
    }
    Speed speed = Speed.multiply(multiply);
    speed.addInput(filterInputs.get(0));
    builder.filter(speed);
    filterInputs.add(speed);
    return filterInputs;
}
Also used : Speed(org.fagu.fmv.ffmpeg.filter.impl.Speed) FilterInput(org.fagu.fmv.ffmpeg.filter.FilterInput)

Aggregations

Speed (org.fagu.fmv.ffmpeg.filter.impl.Speed)2 FFMPEGExecutorBuilder (org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)1 FilterInput (org.fagu.fmv.ffmpeg.filter.FilterInput)1 InputProcessor (org.fagu.fmv.ffmpeg.operation.InputProcessor)1