From 7af6d81f35aea8832023daa30ada10e6673a0529 Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:06:33 -0600 Subject: [PATCH] [fd/ffmpeg] Limit read rate for DASH livestreams (#14918) Authored by: bashonly --- yt_dlp/downloader/external.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py index 1432cdb5e0..82bc5106a5 100644 --- a/yt_dlp/downloader/external.py +++ b/yt_dlp/downloader/external.py @@ -560,6 +560,13 @@ class FFmpegFD(ExternalFD): elif isinstance(conn, str): args += ['-rtmp_conn', conn] + elif protocol == 'http_dash_segments' and info_dict.get('is_live'): + # ffmpeg may try to read past the latest available segments for + # live DASH streams unless we pass `-re`. In modern ffmpeg, this + # is an alias of `-readrate 1`, but `-readrate` was not added + # until ffmpeg 5.0, so we must stick to using `-re` + args += ['-re'] + url = fmt['url'] if self.params.get('enable_file_urls') and url.startswith('file:'): # The default protocol_whitelist is 'file,crypto,data' when reading local m3u8 URLs,