diff --git a/TwitchDownloaderCore/ChatRenderer.cs b/TwitchDownloaderCore/ChatRenderer.cs index 5241de47..2851ccd3 100644 --- a/TwitchDownloaderCore/ChatRenderer.cs +++ b/TwitchDownloaderCore/ChatRenderer.cs @@ -390,6 +390,8 @@ private FfmpegProcess GetFfmpegProcess(FileInfo fileInfo) } }; + _progress.LogVerbose($"Running \"{renderOptions.FfmpegPath}\" in \"{process.StartInfo.WorkingDirectory}\" with args: {process.StartInfo.Arguments}"); + process.Start(); process.BeginErrorReadLine(); process.BeginOutputReadLine(); diff --git a/TwitchDownloaderCore/VideoDownloader.cs b/TwitchDownloaderCore/VideoDownloader.cs index b32d10f6..b2f74b92 100644 --- a/TwitchDownloaderCore/VideoDownloader.cs +++ b/TwitchDownloaderCore/VideoDownloader.cs @@ -386,6 +386,8 @@ private async Task RunFfmpegVideoCopy(string tempFolder, FileInfo outputFil HandleFfmpegOutput(e.Data, encodingTimeRegex, videoLength); }; + _progress.LogVerbose($"Running \"{downloadOptions.FfmpegPath}\" in \"{process.StartInfo.WorkingDirectory}\" with args: {CombineArguments(process.StartInfo.ArgumentList)}"); + process.Start(); process.BeginErrorReadLine(); @@ -401,6 +403,17 @@ private async Task RunFfmpegVideoCopy(string tempFolder, FileInfo outputFil } while (!process.HasExited || !logQueue.IsEmpty); return process.ExitCode; + + static string CombineArguments(IEnumerable args) + { + return string.Join(' ', args.Select(x => + { + if (!x.StartsWith('"') && !x.StartsWith('\'') && x.Contains(' ')) + return $"\"{x}\""; + + return x; + })); + } } private void HandleFfmpegOutput(string output, Regex encodingTimeRegex, TimeSpan videoLength)