pub fn parse_time_str(s: &str) -> Option<f64>
Expand description
Parse a time string in the format HOURS:MM:SS.MILLISECONDS
into a number of seconds.
https://trac.ffmpeg.org/wiki/Seeking#Time-unit
ยงExamples
use async_ffmpeg_sidecar::log_parser::parse_time_str;
assert_eq!(parse_time_str("00:00:00.00"), Some(0.0));
assert_eq!(parse_time_str("5"), Some(5.0));
assert_eq!(parse_time_str("0.123"), Some(0.123));
assert_eq!(parse_time_str("1:00.0"), Some(60.0));
assert_eq!(parse_time_str("1:01.0"), Some(61.0));
assert_eq!(parse_time_str("1:01:01.123"), Some(3661.123));
assert_eq!(parse_time_str("N/A"), None);