1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-22 07:56:49 +00:00

[__init__] Fix missing subtitles if --add-metadata is used (#12423)

The previous fix for #5594 is incorrect
This commit is contained in:
Yen Chi Hsuan 2017-03-11 19:37:45 +08:00
parent a8e687a4da
commit 4605c94d1a
No known key found for this signature in database
GPG Key ID: 7F902A182457CA23
2 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,9 @@
version <unreleased>
Core
* Fix missing subtitles if --add-metadata is used (#12423)
version 2017.03.10
Extractors

View File

@ -259,6 +259,16 @@ def _real_main(argv=None):
'key': 'FFmpegVideoConvertor',
'preferedformat': opts.recodevideo,
})
# FFmpegMetadataPP should be run after FFmpegVideoConvertorPP and
# FFmpegExtractAudioPP as containers before conversion may not support
# metadata (3gp, webm, etc.)
# And this post-processor should be placed before other metadata
# manipulating post-processors (FFmpegEmbedSubtitle) to prevent loss of
# extra metadata. By default ffmpeg preserves metadata applicable for both
# source and target containers. From this point the container won't change,
# so metadata can be added here.
if opts.addmetadata:
postprocessors.append({'key': 'FFmpegMetadata'})
if opts.convertsubtitles:
postprocessors.append({
'key': 'FFmpegSubtitlesConvertor',
@ -276,11 +286,6 @@ def _real_main(argv=None):
})
if not already_have_thumbnail:
opts.writethumbnail = True
# FFmpegMetadataPP should be run after FFmpegVideoConvertorPP and
# FFmpegExtractAudioPP as containers before conversion may not support
# metadata (3gp, webm, etc.)
if opts.addmetadata:
postprocessors.append({'key': 'FFmpegMetadata'})
# XAttrMetadataPP should be run after post-processors that may change file
# contents
if opts.xattrs: