package net.knarcraft.ffmpegconverter.converter; import net.knarcraft.ffmpegconverter.streams.AudioStream; import net.knarcraft.ffmpegconverter.streams.StreamObject; import net.knarcraft.ffmpegconverter.streams.SubtitleStream; import net.knarcraft.ffmpegconverter.streams.VideoStream; import net.knarcraft.ffmpegconverter.utility.FFMpegHelper; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * A converter mainly designed for converting anime to web-playable mp4 */ public class AnimeConverter extends AbstractConverter { private final String[] audioLanguages; private final String[] subtitleLanguages; private final boolean toStereo; private final boolean preventSignsAndSongs; /** * Instantiates a new anime converter * * @param ffprobePath
Path/command to ffprobe.
* @param ffmpegPathPath/command to ffmpeg.
* @param audioLanguagesList of wanted audio languages in descending order.
* @param subtitleLanguagesList of wanted subtitle languages in descending order.
* @param toStereoConvert video with several audio channels to stereo.
* @param preventSignsAndSongsPrevent subtitles only converting signs and songs (not speech).
*/ public AnimeConverter(String ffprobePath, String ffmpegPath, String[] audioLanguages, String[] subtitleLanguages, boolean toStereo, boolean preventSignsAndSongs) { super("mp4"); this.ffprobePath = ffprobePath; this.ffmpegPath = ffmpegPath; this.audioLanguages = audioLanguages; this.subtitleLanguages = subtitleLanguages; this.toStereo = toStereo; this.preventSignsAndSongs = preventSignsAndSongs; } @Override public void convert(File file) throws IOException { processFile(file.getParentFile(), file); } @Override public String[] generateConversionCommand(String executable, File file, List