1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2025-02-01 03:51:42 +01:00

[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
This commit is contained in:
Mike Fährmann 2023-08-21 19:17:14 +02:00
parent 70bdf32a88
commit 2a3acd318a
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -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):