ffmpeg_sidecar::log_parser

Function try_parse_progress

Source
pub fn try_parse_progress(string: &str) -> Option<FfmpegProgress>
Expand description

Parse a progress update line from ffmpeg.

ยงExample

use ffmpeg_sidecar::log_parser::try_parse_progress;
let line = "[info] frame= 1996 fps=1984 q=-1.0 Lsize=     372kB time=00:01:19.72 bitrate=  38.2kbits/s speed=79.2x\n";
let progress = try_parse_progress(line).unwrap();
assert!(progress.frame == 1996);
assert!(progress.fps == 1984.0);
assert!(progress.q == -1.0);
assert!(progress.size_kb == 372);
assert!(progress.time == "00:01:19.72");
assert!(progress.bitrate_kbps == 38.2);
assert!(progress.speed == 79.2);