pub struct Timecode {
pub start_frame: u32,
pub frames_per_second: u8,
pub drop_frame: bool,
pub timescale: u32,
pub frame_duration: u32,
pub flags: u32,
pub reel_name: Option<String>,
}Expand description
A start timecode, as a QuickTime timecode track (tmcd) carries it: the
frame number of the first frame, counted at the nominal rate.
The frame number is the source of truth; fmt::Display
renders it as HH:MM:SS:FF, with ; before the frames when drop-frame.
Fields§
§start_frame: u32Frame number of the first frame.
frames_per_second: u8Nominal frames per second (30 for 29.97, 24 for 23.976).
drop_frame: boolDrop-frame counting (29.97 / 59.94 NTSC).
timescale: u32The exact frame rate as timescale / frame_duration (30000/1001,
25/1, …). A timecode track stores both.
frame_duration: u32§flags: u32Other QuickTime tmcd flag bits (0x2 24-hour max, 0x4 negative times
OK, 0x8 counter); drop-frame is drop_frame.
reel_name: Option<String>The source reel name (tmcd’s name box), when recorded.
Implementations§
Source§impl Timecode
impl Timecode
Sourcepub fn new(start_frame: u32, frames_per_second: u8) -> Timecode
pub fn new(start_frame: u32, frames_per_second: u8) -> Timecode
A non-drop timecode at an integer rate starting at start_frame.
Sourcepub fn parse(text: &str, frames_per_second: u8) -> Option<Timecode>
pub fn parse(text: &str, frames_per_second: u8) -> Option<Timecode>
Parse HH:MM:SS:FF (or HH:MM:SS;FF for drop-frame) at the given
nominal rate. Drop-frame needs a rate that is a multiple of 30.
Sourcepub fn components(&self) -> (u32, u32, u32, u32)
pub fn components(&self) -> (u32, u32, u32, u32)
(hours, minutes, seconds, frames) of start_frame.