Adds a converter for web video and changes behavior of the normal video converter
All checks were successful
KnarCraft/FFmpegConvert/pipeline/head This commit looks good

The normal video converter now includes all streams
The web video converter selects the first of each stream
Changes some method names
Moves the convert command to the abstract converter
This commit is contained in:
2020-05-12 19:56:01 +02:00
parent a516cdcdff
commit f2b2de514e
8 changed files with 94 additions and 49 deletions

View File

@ -4,6 +4,7 @@ import net.knarcraft.ffmpegconverter.converter.AbstractConverter;
import net.knarcraft.ffmpegconverter.converter.AnimeConverter;
import net.knarcraft.ffmpegconverter.converter.AudioConverter;
import net.knarcraft.ffmpegconverter.converter.VideoConverter;
import net.knarcraft.ffmpegconverter.converter.WebVideoConverter;
import net.knarcraft.ffmpegconverter.utility.FileUtil;
import net.knarcraft.ffmpegconverter.utility.ListUtil;
import net.knarcraft.ffmpegconverter.utility.OutputUtil;
@ -27,15 +28,14 @@ class Main {
public static void main(String[] args) throws IOException {
loadConverter();
int recursionSteps = 1;
OutputUtil.println("<Folder/File> [Recursions]: ");
List<String> input = readInput(2);
while (input.isEmpty()) {
OutputUtil.print("File path required.");
List<String> input;
do {
OutputUtil.println("<Folder/File> [Recursions]:");
input = readInput(2);
}
} while (input.isEmpty());
File folder = new File(input.get(0));
int recursionSteps = 1;
if (input.size() > 1) {
try {
recursionSteps = Integer.parseInt(input.get(1));
@ -45,7 +45,6 @@ class Main {
}
convertAllFiles(folder, recursionSteps);
OutputUtil.close();
}
@ -56,7 +55,7 @@ class Main {
*/
private static void loadConverter() throws IOException {
int choice = getChoice("Which converter do you want do use?\n1. Anime to web mp4\n2. Audio converter\n" +
"3. VideoStream converter", 1, 3);
"3. VideoStream converter", 1, 4);
OutputUtil.println("Input for this converter:");
switch (choice) {
@ -69,6 +68,9 @@ class Main {
case 3:
converter = new VideoConverter(FFPROBE_PATH, FFMPEG_PATH, getChoice("<output extension>"));
break;
case 4:
converter = new WebVideoConverter(FFPROBE_PATH, FFMPEG_PATH, getChoice("<output extension>"));
break;
default:
System.exit(1);
}