MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / equal_frame_rate

Method equal_frame_rate

scenedetect/common.py:345–363  ·  view source on GitHub ↗

Determine whether the passed frame rate equals this object's frame rate. Arguments: other: Frame rate to compare against within the precision constant defined in this module (see :data:`MAX_FPS_DELTA`). May be a ``float``, ``Fraction``, or another

(self, other: "float | Fraction | FrameTimecode")

Source from the content-addressed store, hash-verified

343 return self.framerate
344
345 def equal_frame_rate(self, other: "float | Fraction | FrameTimecode") -> bool:
346 """Determine whether the passed frame rate equals this object's frame rate.
347
348 Arguments:
349 other: Frame rate to compare against within the precision constant defined in this
350 module (see :data:`MAX_FPS_DELTA`). May be a ``float``, ``Fraction``, or another
351 :class:`FrameTimecode`.
352 Returns:
353 bool: True if ``other`` matches this :class:`FrameTimecode`'s frame rate within
354 tolerance, False otherwise.
355
356 """
357 if self.frame_rate is None:
358 return False
359 if isinstance(other, FrameTimecode):
360 if other.frame_rate is None:
361 return False
362 other = other.frame_rate
363 return math.fabs(float(self.frame_rate) - float(other)) < MAX_FPS_DELTA
364
365 def equal_framerate(self, fps) -> bool:
366 """[DEPRECATED] Use :meth:`equal_frame_rate` instead."""

Callers 3

equal_framerateMethod · 0.95
_get_other_as_framesMethod · 0.95

Calls

no outgoing calls

Tested by 1