]> jfr.im git - yt-dlp.git/commitdiff
Deprioritize HEVC-over-FLV formats (#5823)
authorLesmiscore <redacted>
Mon, 19 Dec 2022 02:36:14 +0000 (11:36 +0900)
committerGitHub <redacted>
Mon, 19 Dec 2022 02:36:14 +0000 (11:36 +0900)
Authored by: Lesmiscore

yt_dlp/utils.py

index 9697ba1c135da7afad23d359997e0b6b1a6e19a3..65408bf19b013cbe0ba4f03e2ea4f46e15e76d6d 100644 (file)
@@ -6307,6 +6307,12 @@ def calculate_preference(self, format):
         # if format.get('preference') is None and format.get('ext') in ('f4f', 'f4m'):  # Not supported?
         #    format['preference'] = -1000
 
+        if format.get('preference') is None and format.get('ext') == 'flv' and re.match('[hx]265|he?vc?', format.get('vcodec') or ''):
+            # HEVC-over-FLV is out-of-spec by FLV's original spec
+            # ref. https://trac.ffmpeg.org/ticket/6389
+            # ref. https://github.com/yt-dlp/yt-dlp/pull/5821
+            format['preference'] = -100
+
         # Determine missing bitrates
         if format.get('tbr') is None:
             if format.get('vbr') is not None and format.get('abr') is not None: