[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

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