diff --git a/src/main/java/net/knarcraft/ffmpegconverter/FFMpegConvert.java b/src/main/java/net/knarcraft/ffmpegconverter/FFMpegConvert.java index ee9e9d6..a65450d 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/FFMpegConvert.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/FFMpegConvert.java @@ -3,6 +3,7 @@ package net.knarcraft.ffmpegconverter; import net.knarcraft.ffmpegconverter.config.Configuration; import net.knarcraft.ffmpegconverter.converter.AnimeConverter; import net.knarcraft.ffmpegconverter.converter.AudioConverter; +import net.knarcraft.ffmpegconverter.converter.AudioToVorbisConverter; import net.knarcraft.ffmpegconverter.converter.Converter; import net.knarcraft.ffmpegconverter.converter.DownScaleConverter; import net.knarcraft.ffmpegconverter.converter.LetterboxCropper; @@ -98,7 +99,8 @@ public class FFMpegConvert { 9. mp4 Subtitle Embed 10. Anime to h265 all streams 11. Stream reorder - 12. Letterbox cropper""", 1, 12); + 12. Letterbox cropper + 13. Video's Audio to vorbis converter""", 1, 13); return switch (choice) { case 1 -> generateWebAnimeConverter(); @@ -113,6 +115,7 @@ public class FFMpegConvert { case 10 -> generateAnimeConverter(); case 11 -> generateStreamOrderConverter(); case 12 -> new LetterboxCropper(FFPROBE_PATH, FFMPEG_PATH); + case 13 -> new AudioToVorbisConverter(FFPROBE_PATH, FFMPEG_PATH); default -> null; }; } diff --git a/src/main/java/net/knarcraft/ffmpegconverter/converter/AudioToVorbisConverter.java b/src/main/java/net/knarcraft/ffmpegconverter/converter/AudioToVorbisConverter.java new file mode 100644 index 0000000..8b0e053 --- /dev/null +++ b/src/main/java/net/knarcraft/ffmpegconverter/converter/AudioToVorbisConverter.java @@ -0,0 +1,84 @@ +package net.knarcraft.ffmpegconverter.converter; + +import net.knarcraft.ffmpegconverter.container.FFMpegCommand; +import net.knarcraft.ffmpegconverter.container.StreamProbeResult; +import net.knarcraft.ffmpegconverter.converter.module.ConverterModule; +import net.knarcraft.ffmpegconverter.converter.module.DebugModule; +import net.knarcraft.ffmpegconverter.converter.module.ModuleExecutor; +import net.knarcraft.ffmpegconverter.converter.module.mapping.MapAllModule; +import net.knarcraft.ffmpegconverter.converter.module.output.CopySubtitlesModule; +import net.knarcraft.ffmpegconverter.converter.module.output.CopyVideoModule; +import net.knarcraft.ffmpegconverter.converter.module.output.SetOutputFileModule; +import net.knarcraft.ffmpegconverter.streams.AudioStream; +import net.knarcraft.ffmpegconverter.streams.SubtitleStream; +import net.knarcraft.ffmpegconverter.streams.VideoStream; +import net.knarcraft.ffmpegconverter.utility.FFMpegHelper; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; + +/** + * A converter to convert a video's audio into flac + */ +public class AudioToVorbisConverter extends AbstractConverter { + + /** + * Initializes variables used by the abstract converter + * + * @param ffprobePath
Path/command to ffprobe.
+ * @param ffmpegPathPath/command to ffmpeg.
+ */ + public AudioToVorbisConverter(String ffprobePath, String ffmpegPath) { + super("mkv"); + this.ffprobePath = ffprobePath; + this.ffmpegPath = ffmpegPath; + } + + @Override + public @NotNull List