Logging improvements

This commit is contained in:
N00MKRAD
2021-04-26 18:26:16 +02:00
parent dd520cea28
commit ecbb2166cb
3 changed files with 14 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ namespace Flowframes
try try
{ {
if (replaceLastLine) if (!hidden && replaceLastLine)
{ {
textbox.Suspend(); textbox.Suspend();
string[] lines = textbox.Text.SplitIntoLines(); string[] lines = textbox.Text.SplitIntoLines();

View File

@@ -104,7 +104,7 @@ namespace Flowframes
bool hidden = currentLogMode == LogMode.Hidden; bool hidden = currentLogMode == LogMode.Hidden;
if (line.MatchesWildcard("*can produce invalid output*")) // Don't print this kind of warning if (HideMessage(line)) // Don't print certain warnings
hidden = true; hidden = true;
bool replaceLastLine = currentLogMode == LogMode.OnlyLastLine; bool replaceLastLine = currentLogMode == LogMode.OnlyLastLine;
@@ -127,6 +127,17 @@ namespace Flowframes
} }
} }
static bool HideMessage (string msg)
{
string[] hiddenMsgs = new string[] { "can produce invalid output", "deprecated pixel format" };
foreach (string str in hiddenMsgs)
if (msg.MatchesWildcard($"*{str}*"))
return true;
return false;
}
static void FfmpegOutputHandlerSilent (object sendingProcess, DataReceivedEventArgs outLine) static void FfmpegOutputHandlerSilent (object sendingProcess, DataReceivedEventArgs outLine)
{ {
timeSinceLastOutput.Restart(); timeSinceLastOutput.Restart();

View File

@@ -54,7 +54,7 @@ namespace Flowframes.Media
if (extension.Contains("jpg")) if (extension.Contains("jpg"))
{ {
string pixFmt = "-pix_fmt yuvj420p"; string pixFmt = "-pix_fmt yuv420p";
return $"-q:v 1 {pixFmt}"; return $"-q:v 1 {pixFmt}";
} }