mirror of https://github.com/yt-dlp/yt-dlp.git
Move regular subtitles options to their loop
This commit is contained in:
parent
e202aae5d6
commit
62e274f515
|
@ -654,17 +654,19 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
|
||||||
|
|
||||||
input_files = [filename, *sub_filenames]
|
input_files = [filename, *sub_filenames]
|
||||||
|
|
||||||
opts = [
|
opts = [*self.stream_copy_opts(ext=info['ext'])]
|
||||||
*self.stream_copy_opts(ext=info['ext']),
|
|
||||||
|
for i, (lang, name) in enumerate(zip(sub_langs, sub_names)):
|
||||||
|
lang_code = ISO639Utils.short2long(lang) or lang
|
||||||
|
opts.extend([
|
||||||
# Don't copy the existing subtitles, we may be running the
|
# Don't copy the existing subtitles, we may be running the
|
||||||
# postprocessor a second time
|
# postprocessor a second time
|
||||||
'-map', '-0:s',
|
'-map', '-0:s',
|
||||||
]
|
|
||||||
|
|
||||||
for i, (lang, name) in enumerate(zip(sub_langs, sub_names)):
|
'-map', f'{i + 1}:0',
|
||||||
opts.extend(['-map', f'{i + 1}:0'])
|
f'-metadata:s:s:{i}', f'language={lang_code}'
|
||||||
lang_code = ISO639Utils.short2long(lang) or lang
|
])
|
||||||
opts.extend([f'-metadata:s:s:{i}', f'language={lang_code}'])
|
|
||||||
if name:
|
if name:
|
||||||
opts.extend([f'-metadata:s:s:{i}', f'handler_name={name}',
|
opts.extend([f'-metadata:s:s:{i}', f'handler_name={name}',
|
||||||
f'-metadata:s:s:{i}', f'title={name}'])
|
f'-metadata:s:s:{i}', f'title={name}'])
|
||||||
|
|
Loading…
Reference in New Issue