From 2a3acd318a62a5fa7111bfbd483c46e69312ed59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 21 Aug 2023 19:17:14 +0200 Subject: [PATCH] [pp:ugoira] fix high frame rates (#4421) only return an output frame rate for non-uniform ugoira when the frame delay gcd is >= 10, i.e. 100 fps --- gallery_dl/postprocessor/ugoira.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gallery_dl/postprocessor/ugoira.py b/gallery_dl/postprocessor/ugoira.py index 50c4ed38..8e84d5c0 100644 --- a/gallery_dl/postprocessor/ugoira.py +++ b/gallery_dl/postprocessor/ugoira.py @@ -282,10 +282,14 @@ class UgoiraPP(PostProcessor): return timecodes def calculate_framerate(self, frames): - uniform = self._delay_is_uniform(frames) - if uniform: + if self._delay_is_uniform(frames): return ("1000/{}".format(frames[0]["delay"]), None) - return (None, "1000/{}".format(self._delay_gcd(frames))) + + gcd = self._delay_gcd(frames) + if gcd >= 10: + return (None, "1000/{}".format(gcd)) + + return (None, None) @staticmethod def _delay_gcd(frames):