namespace AmiReel.Services; /// /// Recognizes the FFmpeg/FFprobe startup banner and stream-info boilerplate that both the /// live log filter () and the error summarizer /// () want to hide — the version/library banner, input/output /// stream dumps, and the final size/duration summary line are never useful to a user. /// public static class FfmpegOutputFilter { private static readonly string[] BoilerplatePrefixes = [ "ffmpeg version ", "built with ", "configuration:", "libavutil", "libavcodec", "libavformat", "libavdevice", "libavfilter", "libswscale", "libswresample", "Input #", "Output #", "Stream mapping:", "Stream #", "Metadata:", "Duration:", "Press [q] to stop", "video:", "audio:", "subtitle:", "other streams:", "global headers:", "muxing overhead:", ]; public static bool IsBoilerplateLine(string line) => BoilerplatePrefixes.Any(prefix => line.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)); }