For Timecode-backed instances, frame_rate is the approximation passed via fps.
()
| 87 | |
| 88 | |
| 89 | def 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 | |
| 101 | def test_frame_num_and_frame_rate_are_read_only(): |
nothing calls this directly
no test coverage detected