Improves FFMpeg command generation
Adds an object for storing FFmpeg variables. This allows any argument type to be added at any time, removing the limitation of having to add to the command in a specific order. Makes stream objects store the index of the input file they belong to. Saves the result of probes to a record that's easy to pass around. Always passes all probed files to the input files of ffmpeg. Makes it easier to enable h26x encoding/decoding when necessary. Removes the hard-coded behavior for external subtitles, and allows any stream to be an external stream.
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
package net.knarcraft.ffmpegconverter.converter;
|
||||
|
||||
import net.knarcraft.ffmpegconverter.streams.StreamObject;
|
||||
import net.knarcraft.ffmpegconverter.container.StreamProbeResult;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This interface describes a file converter
|
||||
@ -16,6 +16,7 @@ public interface Converter {
|
||||
*
|
||||
* @return <p>A list of valid input formats</p>
|
||||
*/
|
||||
@NotNull
|
||||
String[] getValidFormats();
|
||||
|
||||
/**
|
||||
@ -24,17 +25,18 @@ public interface Converter {
|
||||
* @param file <p>The file to convert.</p>
|
||||
* @throws IOException <p>If the file cannot be converted.</p>
|
||||
*/
|
||||
void convert(File file) throws IOException;
|
||||
void convert(@NotNull 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>
|
||||
* @param executable <p>The executable file for ffmpeg</p>
|
||||
* @param probeResult <p>The result of probing the input file</p>
|
||||
* @param outFile <p>The output file</p>
|
||||
* @return <p>A list of commands</p>
|
||||
*/
|
||||
String[] generateConversionCommand(String executable, File file, List<StreamObject> streams, String outFile);
|
||||
@NotNull
|
||||
String[] generateConversionCommand(@NotNull String executable, @NotNull StreamProbeResult probeResult,
|
||||
@NotNull String outFile);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user