ffmpeg_sidecar::log_parser

Function try_parse_version

Source
pub fn try_parse_version(string: &str) -> Option<String>
Expand description

Parses the ffmpeg version string from the stderr stream, typically the very first line of output:

use ffmpeg_sidecar::log_parser::try_parse_version;

let line = "[info] ffmpeg version 2023-01-18-git-ba36e6ed52-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers\n";

let version = try_parse_version(line).unwrap();

assert!(version == "2023-01-18-git-ba36e6ed52-full_build-www.gyan.dev");