From 32ec50ba7d99e5e2e3aba5cfc5a0eb5b51d84fdf Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 23 Dec 2022 02:09:29 +0100 Subject: [PATCH] Fixes incorrect video stream index This fixes the absolute video stream index being used instead of the relative video stream index when converting a video with image (PGS) subtitles. --- .../net/knarcraft/ffmpegconverter/utility/FFMpegHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/knarcraft/ffmpegconverter/utility/FFMpegHelper.java b/src/main/java/net/knarcraft/ffmpegconverter/utility/FFMpegHelper.java index 367da89..3dd50b0 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/utility/FFMpegHelper.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/utility/FFMpegHelper.java @@ -221,7 +221,7 @@ public final class FFMpegHelper { private static void addInternalImageSubtitle(List command, SubtitleStream subtitleStream, VideoStream videoStream) { command.add("-filter_complex"); - String filter = String.format("[0:v:%d][0:%d]overlay", videoStream.getAbsoluteIndex(), + String filter = String.format("[0:v:%d][0:%d]overlay", videoStream.getRelativeIndex(), subtitleStream.getAbsoluteIndex()); command.add(filter); }