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();
}
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;
}
Aggregations