Skip to content

A feature-rich command-line audio/video downloader

[embedsubtitle] Fix error when duration is unknown

pukkandan1f2a268bd333
diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py
index ad330ab8e5..058926929f 100644
--- a/yt_dlp/postprocessor/ffmpeg.py
+++ b/yt_dlp/postprocessor/ffmpeg.py
@@ -545,7 +545,7 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
return [], information
filename = information['filepath']
- if self._duration_mismatch(
+ if information.get('duration') and self._duration_mismatch(
self._get_real_video_duration(information, False), information['duration']):
self.to_screen(f'Skipping {self.pp_key()} since the real and expected durations mismatch')
return [], information