From b64dbf3c3ef353d0ccb083911802840b260588a8 Mon Sep 17 00:00:00 2001 From: iwconfig Date: Fri, 21 Dec 2018 16:38:15 +0100 Subject: [PATCH] merge: Map video and audio tracks only once When dealing with multiple subtitles, the singular video and audio tracks is added with each subtitle. This of course results in a multiplied file size which we don't want. --- lib/svtplay_dl/postprocess/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/svtplay_dl/postprocess/__init__.py b/lib/svtplay_dl/postprocess/__init__.py index cf25be6..594b290 100644 --- a/lib/svtplay_dl/postprocess/__init__.py +++ b/lib/svtplay_dl/postprocess/__init__.py @@ -181,11 +181,11 @@ class postprocess(object): audio_filename = u"{0}.m4a".format(name) cmd = [self.detect, "-i", orig_filename, "-i", audio_filename] + arguments += ["-map", "{}".format(videotrack), "-map", "{}".format(audiotrack)] if self.config.get("merge_subtitle"): langs = self.sublanguage() for stream_num, language in enumerate(langs, start=audiotrack + 1): - arguments += ["-map", "{}".format(videotrack), "-map", "{}".format(audiotrack), - "-map", str(stream_num), "-c:s:" + str(stream_num - 2), "mov_text", + arguments += ["-map", str(stream_num), "-c:s:" + str(stream_num - 2), "mov_text", "-metadata:s:s:" + str(stream_num - 2), "language=" + language] if self.subfixes and len(self.subfixes) >= 2: for subfix in self.subfixes: