mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-15 18:12:58 +00:00
Merge webm formats into mkv if thumbnails are to be embedded
This was originally implemented in4d971a16b8
(#173) by @damianoamatruda but was reverted in3b297919e0
since it was unintentionally being triggered for `write_thumbnail` (See #500)
This commit is contained in:
parent
8cd69fc407
commit
4e3b637d5b
@ -137,6 +137,7 @@
|
|||||||
from .downloader.rtmp import rtmpdump_version
|
from .downloader.rtmp import rtmpdump_version
|
||||||
from .postprocessor import (
|
from .postprocessor import (
|
||||||
get_postprocessor,
|
get_postprocessor,
|
||||||
|
EmbedThumbnailPP,
|
||||||
FFmpegFixupDurationPP,
|
FFmpegFixupDurationPP,
|
||||||
FFmpegFixupM3u8PP,
|
FFmpegFixupM3u8PP,
|
||||||
FFmpegFixupM4aPP,
|
FFmpegFixupM4aPP,
|
||||||
@ -2696,10 +2697,19 @@ def compatible_formats(formats):
|
|||||||
|
|
||||||
requested_formats = info_dict['requested_formats']
|
requested_formats = info_dict['requested_formats']
|
||||||
old_ext = info_dict['ext']
|
old_ext = info_dict['ext']
|
||||||
if self.params.get('merge_output_format') is None and not compatible_formats(requested_formats):
|
if self.params.get('merge_output_format') is None:
|
||||||
|
if not compatible_formats(requested_formats):
|
||||||
info_dict['ext'] = 'mkv'
|
info_dict['ext'] = 'mkv'
|
||||||
self.report_warning(
|
self.report_warning(
|
||||||
'Requested formats are incompatible for merge and will be merged into mkv.')
|
'Requested formats are incompatible for merge and will be merged into mkv')
|
||||||
|
if (info_dict['ext'] == 'webm'
|
||||||
|
and info_dict.get('thumbnails')
|
||||||
|
# check with type instead of pp_key, __name__, or isinstance
|
||||||
|
# since we dont want any custom PPs to trigger this
|
||||||
|
and any(type(pp) == EmbedThumbnailPP for pp in self._pps['post_process'])):
|
||||||
|
info_dict['ext'] = 'mkv'
|
||||||
|
self.report_warning(
|
||||||
|
'webm doesn\'t support embedding a thumbnail, mkv will be used')
|
||||||
new_ext = info_dict['ext']
|
new_ext = info_dict['ext']
|
||||||
|
|
||||||
def correct_ext(filename, ext=new_ext):
|
def correct_ext(filename, ext=new_ext):
|
||||||
|
Loading…
Reference in New Issue
Block a user