diff --git a/TwitchDownloaderCLI/Modes/Arguments/ChatRenderArgs.cs b/TwitchDownloaderCLI/Modes/Arguments/ChatRenderArgs.cs index 55f1e37c..15704583 100644 --- a/TwitchDownloaderCLI/Modes/Arguments/ChatRenderArgs.cs +++ b/TwitchDownloaderCLI/Modes/Arguments/ChatRenderArgs.cs @@ -116,9 +116,6 @@ internal sealed class ChatRenderArgs : TwitchDownloaderArgs [Option("temp-path", Default = "", HelpText = "Path to temporary folder to use for cache.")] public string TempFolder { get; set; } - [Option("verbose-ffmpeg", Default = false, HelpText = "Prints every message from FFmpeg.")] - public bool LogFfmpegOutput { get; set; } - [Option("skip-drive-waiting", Default = false, HelpText = "Do not wait for the output drive to transmit a ready signal before writing the next frame. Waiting is usually only necessary on low-end USB drives.")] public bool SkipDriveWaiting { get; set; } diff --git a/TwitchDownloaderCLI/Modes/RenderChat.cs b/TwitchDownloaderCLI/Modes/RenderChat.cs index 7f495d4e..87b89486 100644 --- a/TwitchDownloaderCLI/Modes/RenderChat.cs +++ b/TwitchDownloaderCLI/Modes/RenderChat.cs @@ -79,7 +79,6 @@ private static ChatRenderOptions GetRenderOptions(ChatRenderArgs inputOptions, I "system" or "none" => EmojiVendor.None, _ => throw new NotSupportedException("Invalid emoji vendor. Valid values are: 'twitter' / 'twemoji', and 'google' / 'notocolor'") }, - LogFfmpegOutput = inputOptions.LogFfmpegOutput, SkipDriveWaiting = inputOptions.SkipDriveWaiting, EmoteScale = inputOptions.ScaleEmote, BadgeScale = inputOptions.ScaleBadge, diff --git a/TwitchDownloaderCLI/README.md b/TwitchDownloaderCLI/README.md index 623c121d..1729c744 100644 --- a/TwitchDownloaderCLI/README.md +++ b/TwitchDownloaderCLI/README.md @@ -279,9 +279,6 @@ Other = `1`, Broadcaster = `2`, Moderator = `4`, VIP = `8`, Subscriber = `16`, P **--temp-path** (Default: ` `) Path to temporary folder for cache. -**--verbose-ffmpeg** -(Default: `false`) Prints every message from FFmpeg. - **--skip-drive-waiting** (Default: `false`) Do not wait for the output drive to transmit a ready signal before writing the next frame. Waiting is usually only necessary on low-end USB drives. Skipping can result in 1-5% render speed increases. diff --git a/TwitchDownloaderCLI/Tools/PreParseArgs.cs b/TwitchDownloaderCLI/Tools/PreParseArgs.cs index af4f892d..0f9576d6 100644 --- a/TwitchDownloaderCLI/Tools/PreParseArgs.cs +++ b/TwitchDownloaderCLI/Tools/PreParseArgs.cs @@ -53,6 +53,12 @@ private static string[] ConvertFromOldSyntax(string[] args, string processFileNa processedArgs = ConvertSilentSyntax(processedArgs); } + if (args.Any(x => x is "--verbose-ffmpeg")) + { + Console.WriteLine("[INFO] The program has switched from --verbose-ffmpeg to log levels, consider using log levels instead. '--log-level Status,Info,Warning,Error,Ffmpeg' will be applied to the current session. Run \'{0} help\' for more information.", processFileName); + processedArgs = ConvertVerboseFfmpegSyntax(processedArgs); + } + return processedArgs.ToArray(); } @@ -107,5 +113,22 @@ private static List ConvertSilentSyntax(List args) return args; } + + private static List ConvertVerboseFfmpegSyntax(List args) + { + for (var i = 0; i < args.Count; i++) + { + if (args[i].Equals("--verbose-ffmpeg")) + { + // If the user is still using --verbose-ffmpeg they probably aren't using log levels yet, so its safe to assume that there won't be a double-parse error + args[i] = "--log-level"; + var logLevels = Enum.GetNames(typeof(LogLevel)) + .Where(x => x is not nameof(LogLevel.None) and not nameof(LogLevel.Verbose)); + args.Insert(i + 1, string.Join(',', logLevels)); + } + } + + return args; + } } } diff --git a/TwitchDownloaderCore/ChatRenderer.cs b/TwitchDownloaderCore/ChatRenderer.cs index cd2a72b3..6fa35f64 100644 --- a/TwitchDownloaderCore/ChatRenderer.cs +++ b/TwitchDownloaderCore/ChatRenderer.cs @@ -382,16 +382,13 @@ private FfmpegProcess GetFfmpegProcess(int partNumber, bool isMask) SavePath = savePath }; - if (renderOptions.LogFfmpegOutput && _progress != null) + process.ErrorDataReceived += (_, e) => { - process.ErrorDataReceived += (_, e) => + if (e.Data != null) { - if (e.Data != null) - { - _progress.LogFfmpeg(e.Data); - } - }; - } + _progress.LogFfmpeg(e.Data); + } + }; process.Start(); process.BeginErrorReadLine(); diff --git a/TwitchDownloaderCore/Options/ChatRenderOptions.cs b/TwitchDownloaderCore/Options/ChatRenderOptions.cs index b7d061f0..d105ce14 100644 --- a/TwitchDownloaderCore/Options/ChatRenderOptions.cs +++ b/TwitchDownloaderCore/Options/ChatRenderOptions.cs @@ -83,7 +83,6 @@ public string MaskFile public int AccentStrokeWidth => (int)(8 * ReferenceScale * AccentStrokeScale); public int AccentIndentWidth => (int)(32 * ReferenceScale * AccentIndentScale); public bool Offline { get; set; } - public bool LogFfmpegOutput { get; set; } = false; public bool BlockArtPreWrap { get; set; } = false; public double BlockArtPreWrapWidth { get; set; } public float BlockArtCharWidth { get; set; } diff --git a/TwitchDownloaderWPF/PageChatRender.xaml.cs b/TwitchDownloaderWPF/PageChatRender.xaml.cs index ed1e8e93..4b513058 100644 --- a/TwitchDownloaderWPF/PageChatRender.xaml.cs +++ b/TwitchDownloaderWPF/PageChatRender.xaml.cs @@ -136,7 +136,6 @@ public ChatRenderOptions GetOptions(string filename) Offline = checkOffline.IsChecked.GetValueOrDefault(), AllowUnlistedEmotes = true, DisperseCommentOffsets = checkDispersion.IsChecked.GetValueOrDefault(), - LogFfmpegOutput = true }; if (RadioEmojiNotoColor.IsChecked == true) options.EmojiVendor = EmojiVendor.GoogleNotoColor;