From 5f2a7f7c4a44aa96054b903534295632044b6ad8 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Mon, 1 Aug 2022 07:14:32 +0530 Subject: [PATCH] [FFmpegThumbnailsConvertor] Fix conversion from GIF Closes #2988 --- yt_dlp/postprocessor/ffmpeg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py index f808389627..45f7ab32ea 100644 --- a/yt_dlp/postprocessor/ffmpeg.py +++ b/yt_dlp/postprocessor/ffmpeg.py @@ -1083,8 +1083,9 @@ class FFmpegThumbnailsConvertorPP(FFmpegPostProcessor): thumbnail_conv_filename = replace_extension(thumbnail_filename, target_ext) self.to_screen(f'Converting thumbnail "{thumbnail_filename}" to {target_ext}') + _, source_ext = os.path.splitext(thumbnail_filename) self.real_run_ffmpeg( - [(thumbnail_filename, ['-f', 'image2', '-pattern_type', 'none'])], + [(thumbnail_filename, [] if source_ext == '.gif' else ['-f', 'image2', '-pattern_type', 'none'])], [(thumbnail_conv_filename.replace('%', '%%'), self._options(target_ext))]) return thumbnail_conv_filename