Adds ability to force-select specific audio and subtitle streams for the anime converter
All checks were successful
KnarCraft/FFmpegConvert/pipeline/head This commit looks good

This commit is contained in:
2022-10-09 23:53:39 +02:00
parent 388563574f
commit 1323513e46
23 changed files with 144 additions and 49 deletions

View File

@ -9,6 +9,9 @@ import net.knarcraft.ffmpegconverter.utility.FFMpegHelper;
import java.io.File;
import java.util.List;
/**
* A simple converter for web-video
*/
public class WebVideoConverter extends AbstractConverter {
/**
@ -37,9 +40,9 @@ public class WebVideoConverter extends AbstractConverter {
}
//Get first streams from the file
SubtitleStream subtitleStream = getFirstSubtitleStream(streams);
SubtitleStream subtitleStream = getNthSubtitleStream(streams, 0);
VideoStream videoStream = getFirstVideoStream(streams);
AudioStream audioStream = getFirstAudioSteam(streams);
AudioStream audioStream = getNthAudioSteam(streams, 0);
//Add streams to output
FFMpegHelper.addSubtitleAndVideoStream(command, subtitleStream, videoStream, file);