From afbca2e8d07caa11899e08aa42369156544734f9 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Sun, 10 May 2020 23:17:30 +0200 Subject: [PATCH] QuietArgument -> VerbosityLevelArgument More options Former-commit-id: af77e48f28d37adc909e66498c374dcfe80a39c5 --- FFMpegCore/FFMpeg/Arguments/QuietArgument.cs | 7 ------ .../Arguments/VerbosityLevelArgument.cs | 25 +++++++++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) delete mode 100644 FFMpegCore/FFMpeg/Arguments/QuietArgument.cs create mode 100644 FFMpegCore/FFMpeg/Arguments/VerbosityLevelArgument.cs diff --git a/FFMpegCore/FFMpeg/Arguments/QuietArgument.cs b/FFMpegCore/FFMpeg/Arguments/QuietArgument.cs deleted file mode 100644 index 2bab939..0000000 --- a/FFMpegCore/FFMpeg/Arguments/QuietArgument.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace FFMpegCore.Arguments -{ - public class QuietArgument : IArgument - { - public string Text => "-hide_banner -loglevel warning"; - } -} \ No newline at end of file diff --git a/FFMpegCore/FFMpeg/Arguments/VerbosityLevelArgument.cs b/FFMpegCore/FFMpeg/Arguments/VerbosityLevelArgument.cs new file mode 100644 index 0000000..f128aeb --- /dev/null +++ b/FFMpegCore/FFMpeg/Arguments/VerbosityLevelArgument.cs @@ -0,0 +1,25 @@ +namespace FFMpegCore.Arguments +{ + public class VerbosityLevelArgument : IArgument + { + private readonly VerbosityLevel _verbosityLevel; + + public VerbosityLevelArgument(VerbosityLevel verbosityLevel) + { + _verbosityLevel = verbosityLevel; + } + public string Text => $"{((int)_verbosityLevel < 32 ? "-hide_banner " : "")}-loglevel {_verbosityLevel.ToString().ToLowerInvariant()}"; + } + + public enum VerbosityLevel + { + Quiet = -8, + Fatal = 8, + Error = 16, + Warning = 24, + Info = 32, + Verbose = 40, + Debug = 48, + Trace = 56 + } +} \ No newline at end of file