mirror of
https://github.com/n00mkrad/flowframes.git
synced 2026-09-01 19:51:28 +02:00
Better warning for multi-pass interpolations, warning when using cmd debug mode
This commit is contained in:
@@ -411,9 +411,6 @@ namespace Flowframes
|
||||
return;
|
||||
|
||||
string aiName = GetAi().aiName.Replace("_", "-");
|
||||
|
||||
if (!Program.busy && guiFactor > 2 && GetAi().multiPass && Config.GetInt(Config.Key.autoEncMode) > 0 && !Logger.GetLastLine().Contains(aiName))
|
||||
Logger.Log($"Warning: {aiName} doesn't natively support 4x/8x and will run multiple times for {guiFactor}x. Auto-Encode will only work on the last run.");
|
||||
}
|
||||
|
||||
public void ValidateFactor ()
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Flowframes.Main
|
||||
int maxFrames = chunkSize + (0.5f * chunkSize).RoundToInt() + safetyBufferFrames;
|
||||
bool overwhelmed = unencodedFrameLines.Count > maxFrames;
|
||||
|
||||
if(overwhelmed && !AiProcessSuspend.aiProcFrozen)
|
||||
if(overwhelmed && !AiProcessSuspend.aiProcFrozen && OsUtils.IsProcessHidden(AiProcess.lastAiProcess))
|
||||
{
|
||||
string dirSize = FormatUtils.Bytes(IoUtils.GetDirSize(Interpolate.current.interpFolder, true));
|
||||
Logger.Log($"AutoEnc is overwhelmed! ({unencodedFrameLines.Count} unencoded frames > {maxFrames}) - Pausing.", true);
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace Flowframes
|
||||
if (!ResumeUtils.resumeNextRun && !Utils.CheckDeleteOldTempFolder()) return; // Try to delete temp folder if an old one exists
|
||||
if (!Utils.CheckPathValid(current.inPath)) return; // Check if input path/file is valid
|
||||
if (!(await Utils.CheckEncoderValid())) return; // Check NVENC compat
|
||||
Utils.ShowWarnings(current.interpFactor, current.ai);
|
||||
currentInputFrameCount = await GetFrameCountCached.GetFrameCountAsync(current.inPath);
|
||||
current.stepByStep = false;
|
||||
Program.mainForm.SetStatus("Starting...");
|
||||
|
||||
@@ -172,6 +172,20 @@ namespace Flowframes.Main
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void ShowWarnings (float factor, AI ai)
|
||||
{
|
||||
string aiName = ai.aiName.Replace("_", "-");
|
||||
|
||||
if (factor > 2 && ai.multiPass && Config.GetInt(Config.Key.autoEncMode) > 0)
|
||||
{
|
||||
int times = (int)Math.Log(factor, 2);
|
||||
Logger.Log($"Warning: {aiName} can only do 2x at a time and will run {times} times for {factor}x. Auto-Encode will only work on the last run.");
|
||||
}
|
||||
|
||||
if (Config.GetInt(Config.Key.cmdDebugMode) > 0)
|
||||
Logger.Log($"Warning: The CMD window for interpolation is enabled. This will disable Auto-Encode and the progress bar!");
|
||||
}
|
||||
|
||||
public static bool CheckPathValid(string path)
|
||||
{
|
||||
if (IoUtils.IsPathDirectory(path))
|
||||
|
||||
@@ -53,6 +53,34 @@ namespace Flowframes.Os
|
||||
return proc;
|
||||
}
|
||||
|
||||
public static bool IsProcessHidden(Process proc)
|
||||
{
|
||||
bool defaultVal = true;
|
||||
|
||||
try
|
||||
{
|
||||
if(proc == null)
|
||||
{
|
||||
Logger.Log($"IsProcessHidden was called but proc is null, defaulting to {defaultVal}", true);
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
if (proc.HasExited)
|
||||
{
|
||||
Logger.Log($"IsProcessHidden was called but proc has already exited, defaulting to {defaultVal}", true);
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
ProcessStartInfo si = proc.StartInfo;
|
||||
return !si.UseShellExecute && si.CreateNoWindow;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Log($"IsProcessHidden errored, defaulting to {defaultVal}: {e.Message}", true);
|
||||
return defaultVal;
|
||||
}
|
||||
}
|
||||
|
||||
public static Process NewProcess(bool hidden, string filename = "cmd.exe")
|
||||
{
|
||||
Process proc = new Process();
|
||||
|
||||
Reference in New Issue
Block a user