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

Function test_frame_rate_for_vfr

tests/test_timecode.py:89–98  ·  view source on GitHub ↗

For Timecode-backed instances, frame_rate is the approximation passed via fps.

()

Source from the content-addressed store, hash-verified

87
88
89def test_frame_rate_for_vfr():
90 """For Timecode-backed instances, frame_rate is the approximation passed via fps."""
91 fps = Fraction(24000, 1001)
92 tc = FrameTimecode(timecode=Timecode(pts=1001, time_base=Fraction(1, 24000)), fps=fps)
93 # frame_rate exposes the rate carried by the FrameTimecode (an approximation for VFR).
94 assert tc.frame_rate == fps
95 # time_base is authoritative for VFR and need not equal 1 / frame_rate.
96 assert tc.time_base == Fraction(1, 24000)
97 assert tc.frame_rate is not None
98 assert tc.time_base != 1 / tc.frame_rate
99
100
101def test_frame_num_and_frame_rate_are_read_only():

Callers

nothing calls this directly

Calls 2

FrameTimecodeClass · 0.90
TimecodeClass · 0.90

Tested by

no test coverage detected