use of org.fagu.fmv.ffmpeg.operation.InputProcessor in project fmv by f-agu.
the class FFHelper method fade2.
/**
* @param inFile
* @param outFile
* @param fadeType
* @param duration
* @throws IOException
*/
public static void fade2(File inFile, File outFile, FadeType fadeType, Duration duration) throws IOException {
FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
InputProcessor inputProcessor = builder.addMediaInputFile(inFile);
Fade fade = Fade.create(fadeType, Time.valueOf(0), duration);
fade.addInput(inputProcessor);
builder.filter(fade);
builder.addMediaOutputFile(outFile).overwrite();
FFExecutor<Object> executor = builder.build();
executor.execute();
}
use of org.fagu.fmv.ffmpeg.operation.InputProcessor in project fmv by f-agu.
the class FFMPEGExecutorBuilder method demux.
/**
* @param muxer
* @return
*/
public InputProcessor demux(Demuxer<?> demuxer) {
MediaInput mediaInput = demuxer.getMediaInput();
InputProcessor inputProcessor = addMediaInput(mediaInput);
demuxer.eventAdded(inputProcessor, mediaInput);
inputProcessor.format(demuxer.name());
return inputProcessor;
}
use of org.fagu.fmv.ffmpeg.operation.InputProcessor in project fmv by f-agu.
the class FFMPEGExecutorBuilder method addMediaInput.
/**
* @param input
* @return
*/
public InputProcessor addMediaInput(MediaInput input) {
if (input instanceof Demuxer) {
return demux((Demuxer<?>) input);
}
Processor<?> processor = defaultFFMPEGOperation.getProcessor(input);
if (processor != null && !(processor instanceof InputProcessor)) {
throw new IllegalArgumentException("Already defined: " + input);
}
InputParameters inputParameters = defaultFFMPEGOperation.getInputParameters();
return inputParameters.addInput(input);
}
use of org.fagu.fmv.ffmpeg.operation.InputProcessor in project fmv by f-agu.
the class SourceSource method createAndAdd.
/**
* @see org.fagu.fmv.core.exec.Source#createAndAdd(org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder)
*/
@Override
public FilterInput createAndAdd(FFMPEGExecutorBuilder builder) {
InputProcessor inputProcessor = builder.addMediaInputFile(getProject().getSource(number).getFile());
ObjectInvoker.invoke(inputProcessor, attributeMap);
return inputProcessor;
}
use of org.fagu.fmv.ffmpeg.operation.InputProcessor in project fmv by f-agu.
the class FilterGraphUI method addRoot.
// **************************************************
/**
*/
private void addRoot() {
Map<InputProcessor, Node> inputProcessorNodeMap = new HashMap<>();
operation.getInputProcessorStream().forEach(ip -> {
for (OutputKey outputKey : ip.getOutputKeys()) {
Node node = createRootNode(ip, outputKey);
inputProcessorNodeMap.put(ip, node);
}
});
for (FilterComplex rootFC : filterGraph.getRoots()) {
Map<IOKey, In> inputMap = rootFC.getInputMap();
if (!inputMap.isEmpty()) {
for (Entry<IOKey, In> entry : inputMap.entrySet()) {
FilterInput filterInput = entry.getValue().getFilterInput();
if (filterInput instanceof InputProcessor) {
Node node = inputProcessorNodeMap.get(filterInput);
Edge edge = graph.addEdge(node.getId() + "-" + rootFC.toString(), createOrGetNode(rootFC), node);
// edge.addAttribute("ui.label", values);
}
}
}
}
}
Aggregations