Fixes incorrect video stream index
All checks were successful
KnarCraft/FFmpegConvert/pipeline/head This commit looks good

This fixes the absolute video stream index being used instead of the relative video stream index when converting a video with image (PGS) subtitles.
This commit is contained in:
Kristian Knarvik 2022-12-23 02:09:29 +01:00
parent 3c298f623e
commit 32ec50ba7d

View File

@ -221,7 +221,7 @@ public final class FFMpegHelper {
private static void addInternalImageSubtitle(List<String> command, SubtitleStream subtitleStream, private static void addInternalImageSubtitle(List<String> command, SubtitleStream subtitleStream,
VideoStream videoStream) { VideoStream videoStream) {
command.add("-filter_complex"); 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()); subtitleStream.getAbsoluteIndex());
command.add(filter); command.add(filter);
} }