Improves converters to remove some code duplication

This commit is contained in:
2020-05-11 13:30:15 +02:00
parent 7f479fd760
commit b42b713e73
5 changed files with 55 additions and 101 deletions

View File

@ -1,7 +1,10 @@
package net.knarcraft.ffmpegconverter.converter;
import net.knarcraft.ffmpegconverter.streams.StreamObject;
import java.io.File;
import java.io.IOException;
import java.util.List;
/**
* This interface describes a file converter
@ -15,4 +18,15 @@ public interface Converter {
* @throws IOException <p>If the file cannot be converted.</p>
*/
void convert(File file) throws IOException;
/**
* Generates a command for a ProcessBuilder.
*
* @param executable <p>The executable file for ffmpeg.</p>
* @param file <p>The input file.</p>
* @param streams <p>A list of ffprobe streams.</p>
* @param outFile <p>The output file.</p>
* @return <p>A list of commands</p>
*/
String[] builderCommand(String executable, File file, List<StreamObject> streams, String outFile);
}