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

Function test_rational_framerate_precision

tests/test_timecode.py:365–371  ·  view source on GitHub ↗

Rational framerates should round-trip frame/second conversions without drift.

()

Source from the content-addressed store, hash-verified

363
364
365def test_rational_framerate_precision():
366 """Rational framerates should round-trip frame/second conversions without drift."""
367 fps = Fraction(24000, 1001)
368 # Verify that frame_num round-trips through seconds without drift over many frames.
369 for frame in [0, 1, 100, 1000, 10000, 100000]:
370 tc = FrameTimecode(frame, fps)
371 assert tc.frame_num == frame, f"Frame {frame} drifted to {tc.frame_num}"
372
373
374def test_ntsc_framerate_detection():

Callers

nothing calls this directly

Calls 1

FrameTimecodeClass · 0.90

Tested by

no test coverage detected