pub struct FrameRate { /* private fields */ }Expand description
A timecode frame rate: a nominal frame count, whether frames run 1000/1001 slower (the NTSC family), and whether labels use drop-frame counting.
Only the 19 combinations in FrameRate::ALL exist. Drop-frame counting needs a nominal rate
of 30, 60 or 120 and skips 2, 4 or 8 labels at the start of every minute not divisible by ten.
29.97 DF and 59.94 DF follow SMPTE ST 12-1. 30 DF, 60 DF, 120 DF and 119.88 DF follow the same
rule as Pro Tools labels them.
Implementations§
Source§impl FrameRate
impl FrameRate
Sourcepub const FPS_23_976: Self
pub const FPS_23_976: Self
24000/1001 frames per second, counted as 24.
Sourcepub const FPS_29_97_DF: Self
pub const FPS_29_97_DF: Self
30000/1001 frames per second with drop-frame labels.
Sourcepub const FPS_47_952: Self
pub const FPS_47_952: Self
48000/1001 frames per second, counted as 48.
Sourcepub const FPS_59_94_DF: Self
pub const FPS_59_94_DF: Self
60000/1001 frames per second with drop-frame labels.
Sourcepub const FPS_119_88: Self
pub const FPS_119_88: Self
120000/1001 frames per second, counted as 120 without dropping labels.
Sourcepub const FPS_119_88_DF: Self
pub const FPS_119_88_DF: Self
120000/1001 frames per second with drop-frame labels.
Sourcepub const FPS_120_DF: Self
pub const FPS_120_DF: Self
120 frames per second with drop-frame labels.
Sourcepub const fn new(
nominal: u8,
ntsc: bool,
drop_frame: bool,
) -> Result<Self, TimecodeError>
pub const fn new( nominal: u8, ntsc: bool, drop_frame: bool, ) -> Result<Self, TimecodeError>
Looks up the rate with nominal labels per second, running 1000/1001 slower when ntsc
is set, and counting drop-frame labels when drop_frame is set.
§Errors
TimecodeError::UnsupportedFrameRate when the combination is not in FrameRate::ALL,
such as 25 DF or 50 with the 1000/1001 factor.
Sourcepub const fn is_ntsc(self) -> bool
pub const fn is_ntsc(self) -> bool
Whether frames run at 1000/1001 of the nominal rate, as 23.976 and 29.97 do.
Sourcepub const fn is_drop_frame(self) -> bool
pub const fn is_drop_frame(self) -> bool
Whether labels use drop-frame counting.
Sourcepub const fn frames_per_second(self) -> Ratio
pub const fn frames_per_second(self) -> Ratio
The exact number of frames per real-time second.
Sourcepub const fn frames_per_day(self) -> u32
pub const fn frames_per_day(self) -> u32
The number of frames from 00:00:00:00 up to, but not including, the next midnight.