Browse Source

[postprocessor/ffmpeg] Embed subtitles with non-standard language codes (refs #18765)

master
Sergey M․ 5 years ago
parent
commit
04fb6928da
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 2 additions and 3 deletions
  1. 5
      youtube_dl/postprocessor/ffmpeg.py

5
youtube_dl/postprocessor/ffmpeg.py

@ -384,9 +384,8 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
opts += ['-c:s', 'mov_text'] opts += ['-c:s', 'mov_text']
for (i, lang) in enumerate(sub_langs): for (i, lang) in enumerate(sub_langs):
opts.extend(['-map', '%d:0' % (i + 1)]) opts.extend(['-map', '%d:0' % (i + 1)])
lang_code = ISO639Utils.short2long(lang)
if lang_code is not None:
opts.extend(['-metadata:s:s:%d' % i, 'language=%s' % lang_code])
lang_code = ISO639Utils.short2long(lang) or lang
opts.extend(['-metadata:s:s:%d' % i, 'language=%s' % lang_code])
temp_filename = prepend_extension(filename, 'temp') temp_filename = prepend_extension(filename, 'temp')
self._downloader.to_screen('[ffmpeg] Embedding subtitles in \'%s\'' % filename) self._downloader.to_screen('[ffmpeg] Embedding subtitles in \'%s\'' % filename)

Loading…
Cancel
Save