From d46f12e6901396e7cbc776449d57e94d2a517502 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Tue, 23 Apr 2024 14:00:15 +0200 Subject: [PATCH] Copies audio and other streams for the MKV to H265 reduced converter --- .../ffmpegconverter/converter/MkvH265ReducedConverter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/knarcraft/ffmpegconverter/converter/MkvH265ReducedConverter.java b/src/main/java/net/knarcraft/ffmpegconverter/converter/MkvH265ReducedConverter.java index 0cecae6..e6b0a42 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/converter/MkvH265ReducedConverter.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/converter/MkvH265ReducedConverter.java @@ -8,6 +8,7 @@ import net.knarcraft.ffmpegconverter.converter.module.ModuleExecutor; import net.knarcraft.ffmpegconverter.converter.module.hardwarecoding.H265HardwareEncodingModule; import net.knarcraft.ffmpegconverter.converter.module.hardwarecoding.HardwareDecodeModule; import net.knarcraft.ffmpegconverter.converter.module.mapping.MapAllModule; +import net.knarcraft.ffmpegconverter.converter.module.output.CopyAudioModule; import net.knarcraft.ffmpegconverter.converter.module.output.CopySubtitlesModule; import net.knarcraft.ffmpegconverter.converter.module.output.FastStartModule; import net.knarcraft.ffmpegconverter.converter.module.output.SetOutputFileModule; @@ -68,6 +69,7 @@ public class MkvH265ReducedConverter extends AbstractConverter { List audioStreams = probeResult.getAudioStreams(); if (!audioStreams.isEmpty()) { modules.add(new MapAllModule<>(audioStreams)); + modules.add(new CopyAudioModule()); } // Map subtitles if present @@ -77,8 +79,11 @@ public class MkvH265ReducedConverter extends AbstractConverter { modules.add(new CopySubtitlesModule()); } - modules.add(new SetOutputFileModule(outFile)); + // Map any fonts, cover images or similar + modules.add(new MapAllModule<>(probeResult.getOtherStreams())); + // Set output file and execute + modules.add(new SetOutputFileModule(outFile)); new ModuleExecutor(command, modules).execute(); return command; }