mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 09:01:43 +00:00
Skip some fixup if remux/recode is needed (#4266)
Authored by: Lesmiscore
This commit is contained in:
parent
47cdc68e03
commit
ca9def714a
@ -43,9 +43,11 @@
|
|||||||
FFmpegFixupTimestampPP,
|
FFmpegFixupTimestampPP,
|
||||||
FFmpegMergerPP,
|
FFmpegMergerPP,
|
||||||
FFmpegPostProcessor,
|
FFmpegPostProcessor,
|
||||||
|
FFmpegVideoConvertorPP,
|
||||||
MoveFilesAfterDownloadPP,
|
MoveFilesAfterDownloadPP,
|
||||||
get_postprocessor,
|
get_postprocessor,
|
||||||
)
|
)
|
||||||
|
from .postprocessor.ffmpeg import resolve_mapping as resolve_recode_mapping
|
||||||
from .update import detect_variant
|
from .update import detect_variant
|
||||||
from .utils import (
|
from .utils import (
|
||||||
DEFAULT_OUTTMPL,
|
DEFAULT_OUTTMPL,
|
||||||
@ -3181,22 +3183,23 @@ def ffmpeg_fixup(cndn, msg, cls):
|
|||||||
self.report_warning(f'{vid}: {msg}. Install ffmpeg to fix this automatically')
|
self.report_warning(f'{vid}: {msg}. Install ffmpeg to fix this automatically')
|
||||||
|
|
||||||
stretched_ratio = info_dict.get('stretched_ratio')
|
stretched_ratio = info_dict.get('stretched_ratio')
|
||||||
ffmpeg_fixup(
|
ffmpeg_fixup(stretched_ratio not in (1, None),
|
||||||
stretched_ratio not in (1, None),
|
f'Non-uniform pixel ratio {stretched_ratio}',
|
||||||
f'Non-uniform pixel ratio {stretched_ratio}',
|
FFmpegFixupStretchedPP)
|
||||||
FFmpegFixupStretchedPP)
|
|
||||||
|
|
||||||
ffmpeg_fixup(
|
|
||||||
(info_dict.get('requested_formats') is None
|
|
||||||
and info_dict.get('container') == 'm4a_dash'
|
|
||||||
and info_dict.get('ext') == 'm4a'),
|
|
||||||
'writing DASH m4a. Only some players support this container',
|
|
||||||
FFmpegFixupM4aPP)
|
|
||||||
|
|
||||||
downloader = get_suitable_downloader(info_dict, self.params) if 'protocol' in info_dict else None
|
downloader = get_suitable_downloader(info_dict, self.params) if 'protocol' in info_dict else None
|
||||||
downloader = downloader.FD_NAME if downloader else None
|
downloader = downloader.FD_NAME if downloader else None
|
||||||
|
|
||||||
if info_dict.get('requested_formats') is None: # Not necessary if doing merger
|
ext = info_dict.get('ext')
|
||||||
|
postprocessed_by_ffmpeg = info_dict.get('requested_formats') or any((
|
||||||
|
isinstance(pp, FFmpegVideoConvertorPP)
|
||||||
|
and resolve_recode_mapping(ext, pp.mapping)[0] not in (ext, None)
|
||||||
|
) for pp in self._pps['post_process'])
|
||||||
|
|
||||||
|
if not postprocessed_by_ffmpeg:
|
||||||
|
ffmpeg_fixup(ext == 'm4a' and info_dict.get('container') == 'm4a_dash',
|
||||||
|
'writing DASH m4a. Only some players support this container',
|
||||||
|
FFmpegFixupM4aPP)
|
||||||
ffmpeg_fixup(downloader == 'hlsnative' and not self.params.get('hls_use_mpegts')
|
ffmpeg_fixup(downloader == 'hlsnative' and not self.params.get('hls_use_mpegts')
|
||||||
or info_dict.get('is_live') and self.params.get('hls_use_mpegts') is None,
|
or info_dict.get('is_live') and self.params.get('hls_use_mpegts') is None,
|
||||||
'Possible MPEG-TS in MP4 container or malformed AAC timestamps',
|
'Possible MPEG-TS in MP4 container or malformed AAC timestamps',
|
||||||
|
Loading…
Reference in New Issue
Block a user