diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-11-04 02:24:12 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-11-04 02:24:12 +0530 |
commit | 832e9000c71c5bbd97c93d21051044cf61a3b87f (patch) | |
tree | c5146118a2aa2f4095b96f07d8c368a1f0d18a1a /yt_dlp/postprocessor/ffmpeg.py | |
parent | 673c0057e81410b3da2b0c07ebf7abca13286eab (diff) | |
download | hypervideo-pre-832e9000c71c5bbd97c93d21051044cf61a3b87f.tar.lz hypervideo-pre-832e9000c71c5bbd97c93d21051044cf61a3b87f.tar.xz hypervideo-pre-832e9000c71c5bbd97c93d21051044cf61a3b87f.zip |
[ffmpeg] Accurately detect presence of setts
Closes #1237
Diffstat (limited to 'yt_dlp/postprocessor/ffmpeg.py')
-rw-r--r-- | yt_dlp/postprocessor/ffmpeg.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py index 3f82eabf5..139b97fb4 100644 --- a/yt_dlp/postprocessor/ffmpeg.py +++ b/yt_dlp/postprocessor/ffmpeg.py @@ -99,7 +99,10 @@ class FFmpegPostProcessor(PostProcessor): if prog != 'ffmpeg' or not out: return - self._features['fdk'] = '--enable-libfdk-aac' in out + self._features = { + 'fdk': '--enable-libfdk-aac' in out, + 'setts': 'setts' in out.splitlines(), + } self.basename = None self.probe_basename = None @@ -827,11 +830,10 @@ class FFmpegFixupTimestampPP(FFmpegFixupPostProcessor): @PostProcessor._restrict_to(images=False) def run(self, info): - required_version = '4.4' - if is_outdated_version(self._versions[self.basename], required_version): + if not self._features.get('setts'): self.report_warning( 'A re-encode is needed to fix timestamps in older versions of ffmpeg. ' - f'Please install ffmpeg {required_version} or later to fixup without re-encoding') + 'Please install ffmpeg 4.4 or later to fixup without re-encoding') opts = ['-vf', 'setpts=PTS-STARTPTS'] else: opts = ['-c', 'copy', '-bsf', 'setts=ts=TS-STARTPTS'] |