mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 08:27:44 +01:00
Tear out unused/broken cmdDebugMode (run processes in visible window) option
This commit is contained in:
9
CodeLegacy/Forms/DebugForm.Designer.cs
generated
9
CodeLegacy/Forms/DebugForm.Designer.cs
generated
@@ -95,7 +95,7 @@ namespace Flowframes.Forms
|
||||
this.label1.ForeColor = System.Drawing.SystemColors.Control;
|
||||
this.label1.Location = new System.Drawing.Point(3, 3);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(415, 60);
|
||||
this.label1.Size = new System.Drawing.Size(416, 60);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = resources.GetString("label1.Text");
|
||||
//
|
||||
@@ -107,7 +107,7 @@ namespace Flowframes.Forms
|
||||
this.panel1.Controls.Add(this.configDataGrid);
|
||||
this.panel1.Location = new System.Drawing.Point(6, 80);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(900, 310);
|
||||
this.panel1.Size = new System.Drawing.Size(180, 0);
|
||||
this.panel1.TabIndex = 4;
|
||||
//
|
||||
// configDataGrid
|
||||
@@ -124,7 +124,7 @@ namespace Flowframes.Forms
|
||||
this.configDataGrid.Location = new System.Drawing.Point(0, 0);
|
||||
this.configDataGrid.MultiSelect = false;
|
||||
this.configDataGrid.Name = "configDataGrid";
|
||||
this.configDataGrid.Size = new System.Drawing.Size(900, 310);
|
||||
this.configDataGrid.Size = new System.Drawing.Size(180, 0);
|
||||
this.configDataGrid.TabIndex = 0;
|
||||
this.configDataGrid.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.configDataGrid_CellValueChanged);
|
||||
this.configDataGrid.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.configDataGrid_RowsAdded);
|
||||
@@ -150,6 +150,7 @@ namespace Flowframes.Forms
|
||||
//
|
||||
// copyTextClipboardBtn
|
||||
//
|
||||
this.copyTextClipboardBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.copyTextClipboardBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.copyTextClipboardBtn.FlatAppearance.BorderSize = 0;
|
||||
this.copyTextClipboardBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
@@ -215,6 +216,7 @@ namespace Flowframes.Forms
|
||||
//
|
||||
// clearLogsBtn
|
||||
//
|
||||
this.clearLogsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.clearLogsBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.clearLogsBtn.FlatAppearance.BorderSize = 0;
|
||||
this.clearLogsBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
@@ -229,6 +231,7 @@ namespace Flowframes.Forms
|
||||
//
|
||||
// openLogFolderBtn
|
||||
//
|
||||
this.openLogFolderBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.openLogFolderBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.openLogFolderBtn.FlatAppearance.BorderSize = 0;
|
||||
this.openLogFolderBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
|
||||
@@ -126,9 +126,6 @@ To delete an entry, select the line by clicking on the left part, then press DEL
|
||||
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
||||
67
CodeLegacy/Forms/SettingsForm.Designer.cs
generated
67
CodeLegacy/Forms/SettingsForm.Designer.cs
generated
@@ -180,8 +180,6 @@
|
||||
this.label47 = new System.Windows.Forms.Label();
|
||||
this.label46 = new System.Windows.Forms.Label();
|
||||
this.label45 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.cmdDebugMode = new System.Windows.Forms.ComboBox();
|
||||
this.titleLabel = new System.Windows.Forms.Label();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.resetBtn = new HTAlt.WinForms.HTButton();
|
||||
@@ -814,9 +812,9 @@
|
||||
this.label25.Location = new System.Drawing.Point(10, 10);
|
||||
this.label25.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
|
||||
this.label25.Name = "label25";
|
||||
this.label25.Size = new System.Drawing.Size(177, 13);
|
||||
this.label25.Size = new System.Drawing.Size(209, 13);
|
||||
this.label25.TabIndex = 76;
|
||||
this.label25.Text = "Enable Transparency (Experimental)";
|
||||
this.label25.Text = "Enable Alpha/Transparency (Experimental)";
|
||||
//
|
||||
// enableAlpha
|
||||
//
|
||||
@@ -834,9 +832,9 @@
|
||||
this.label4.Location = new System.Drawing.Point(308, 10);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(300, 13);
|
||||
this.label4.Size = new System.Drawing.Size(354, 13);
|
||||
this.label4.TabIndex = 78;
|
||||
this.label4.Text = "Enables Transparency (Alpha) support for GIFs and PNG input";
|
||||
this.label4.Text = "Enables transparency (alpha channel) interpolation with supported formats";
|
||||
//
|
||||
// panHqJpegImport
|
||||
//
|
||||
@@ -1903,17 +1901,15 @@
|
||||
this.debugTab.Controls.Add(this.label47);
|
||||
this.debugTab.Controls.Add(this.label46);
|
||||
this.debugTab.Controls.Add(this.label45);
|
||||
this.debugTab.Controls.Add(this.label3);
|
||||
this.debugTab.Controls.Add(this.cmdDebugMode);
|
||||
this.debugTab.ForeColor = System.Drawing.Color.White;
|
||||
this.debugTab.Name = "debugTab";
|
||||
this.debugTab.Size = new System.Drawing.Size(762, 771);
|
||||
this.debugTab.Size = new System.Drawing.Size(762, 419);
|
||||
this.debugTab.Text = "Developer Options";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(10, 70);
|
||||
this.label7.Location = new System.Drawing.Point(10, 40);
|
||||
this.label7.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(121, 13);
|
||||
@@ -1935,7 +1931,7 @@
|
||||
"Slow",
|
||||
"Slower",
|
||||
"Very Slow"});
|
||||
this.serverCombox.Location = new System.Drawing.Point(280, 67);
|
||||
this.serverCombox.Location = new System.Drawing.Point(280, 37);
|
||||
this.serverCombox.Name = "serverCombox";
|
||||
this.serverCombox.Size = new System.Drawing.Size(250, 21);
|
||||
this.serverCombox.TabIndex = 86;
|
||||
@@ -1944,16 +1940,16 @@
|
||||
//
|
||||
this.ffEncArgs.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.ffEncArgs.ForeColor = System.Drawing.Color.White;
|
||||
this.ffEncArgs.Location = new System.Drawing.Point(280, 180);
|
||||
this.ffEncArgs.Location = new System.Drawing.Point(280, 160);
|
||||
this.ffEncArgs.MinimumSize = new System.Drawing.Size(4, 21);
|
||||
this.ffEncArgs.Name = "ffEncArgs";
|
||||
this.ffEncArgs.Size = new System.Drawing.Size(400, 20);
|
||||
this.ffEncArgs.Size = new System.Drawing.Size(400, 21);
|
||||
this.ffEncArgs.TabIndex = 85;
|
||||
//
|
||||
// label56
|
||||
//
|
||||
this.label56.AutoSize = true;
|
||||
this.label56.Location = new System.Drawing.Point(10, 183);
|
||||
this.label56.Location = new System.Drawing.Point(10, 163);
|
||||
this.label56.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
|
||||
this.label56.Name = "label56";
|
||||
this.label56.Size = new System.Drawing.Size(147, 13);
|
||||
@@ -1964,7 +1960,7 @@
|
||||
//
|
||||
this.label54.AutoSize = true;
|
||||
this.label54.ForeColor = System.Drawing.Color.Silver;
|
||||
this.label54.Location = new System.Drawing.Point(543, 154);
|
||||
this.label54.Location = new System.Drawing.Point(543, 134);
|
||||
this.label54.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
|
||||
this.label54.Name = "label54";
|
||||
this.label54.Size = new System.Drawing.Size(118, 13);
|
||||
@@ -1986,7 +1982,7 @@
|
||||
"Slow",
|
||||
"Slower",
|
||||
"Very Slow"});
|
||||
this.ffEncPreset.Location = new System.Drawing.Point(280, 150);
|
||||
this.ffEncPreset.Location = new System.Drawing.Point(280, 130);
|
||||
this.ffEncPreset.Name = "ffEncPreset";
|
||||
this.ffEncPreset.Size = new System.Drawing.Size(250, 21);
|
||||
this.ffEncPreset.TabIndex = 78;
|
||||
@@ -1994,7 +1990,7 @@
|
||||
// label47
|
||||
//
|
||||
this.label47.AutoSize = true;
|
||||
this.label47.Location = new System.Drawing.Point(10, 153);
|
||||
this.label47.Location = new System.Drawing.Point(10, 133);
|
||||
this.label47.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
|
||||
this.label47.Name = "label47";
|
||||
this.label47.Size = new System.Drawing.Size(174, 13);
|
||||
@@ -2005,12 +2001,12 @@
|
||||
//
|
||||
this.label46.AutoSize = true;
|
||||
this.label46.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label46.Location = new System.Drawing.Point(10, 120);
|
||||
this.label46.Location = new System.Drawing.Point(10, 100);
|
||||
this.label46.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
|
||||
this.label46.Name = "label46";
|
||||
this.label46.Size = new System.Drawing.Size(64, 16);
|
||||
this.label46.Size = new System.Drawing.Size(133, 16);
|
||||
this.label46.TabIndex = 76;
|
||||
this.label46.Text = "FFmpeg";
|
||||
this.label46.Text = "Encoding (ffmpeg)";
|
||||
//
|
||||
// label45
|
||||
//
|
||||
@@ -2023,33 +2019,6 @@
|
||||
this.label45.TabIndex = 75;
|
||||
this.label45.Text = "General";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(10, 40);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(148, 13);
|
||||
this.label3.TabIndex = 28;
|
||||
this.label3.Text = "Show Hidden CMD Windows ";
|
||||
//
|
||||
// cmdDebugMode
|
||||
//
|
||||
this.cmdDebugMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.cmdDebugMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmdDebugMode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.cmdDebugMode.ForeColor = System.Drawing.Color.White;
|
||||
this.cmdDebugMode.FormattingEnabled = true;
|
||||
this.cmdDebugMode.Items.AddRange(new object[] {
|
||||
"No",
|
||||
"Yes, Close After Execution",
|
||||
"Yes, Keep Open After Process Has Exited"});
|
||||
this.cmdDebugMode.Location = new System.Drawing.Point(280, 37);
|
||||
this.cmdDebugMode.Name = "cmdDebugMode";
|
||||
this.cmdDebugMode.Size = new System.Drawing.Size(250, 21);
|
||||
this.cmdDebugMode.TabIndex = 27;
|
||||
this.cmdDebugMode.SelectedIndexChanged += new System.EventHandler(this.cmdDebugMode_SelectedIndexChanged);
|
||||
//
|
||||
// titleLabel
|
||||
//
|
||||
this.titleLabel.AutoSize = true;
|
||||
@@ -2098,7 +2067,7 @@
|
||||
this.onlyShowRelevantSettings.Name = "onlyShowRelevantSettings";
|
||||
this.onlyShowRelevantSettings.Size = new System.Drawing.Size(179, 34);
|
||||
this.onlyShowRelevantSettings.TabIndex = 0;
|
||||
this.onlyShowRelevantSettings.Text = "Only show relevant settings";
|
||||
this.onlyShowRelevantSettings.Text = "Only Show Relevant Settings";
|
||||
this.onlyShowRelevantSettings.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// SettingsForm
|
||||
@@ -2215,8 +2184,6 @@
|
||||
private System.Windows.Forms.CheckBox keepAudio;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox dedupMode;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.ComboBox cmdDebugMode;
|
||||
private System.Windows.Forms.Label dedupeSensLabel;
|
||||
private System.Windows.Forms.CheckBox enableLoop;
|
||||
private System.Windows.Forms.Label label15;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Flowframes.Data;
|
||||
using Flowframes.IO;
|
||||
using Flowframes.MiscUtils;
|
||||
using Flowframes.Os;
|
||||
using Flowframes.Ui;
|
||||
using Microsoft.WindowsAPICodePack.Dialogs;
|
||||
@@ -146,7 +145,6 @@ namespace Flowframes.Forms
|
||||
ConfigParser.SaveComboxIndex(loopMode);
|
||||
ConfigParser.SaveGuiElement(fixOutputDuration);
|
||||
// Debugging
|
||||
ConfigParser.SaveComboxIndex(cmdDebugMode);
|
||||
ConfigParser.SaveComboxIndex(serverCombox);
|
||||
ConfigParser.SaveGuiElement(ffEncPreset);
|
||||
ConfigParser.SaveGuiElement(ffEncArgs);
|
||||
@@ -193,7 +191,6 @@ namespace Flowframes.Forms
|
||||
ConfigParser.LoadComboxIndex(loopMode);
|
||||
ConfigParser.LoadGuiElement(fixOutputDuration);
|
||||
// Debugging
|
||||
ConfigParser.LoadComboxIndex(cmdDebugMode);
|
||||
ConfigParser.LoadComboxIndex(serverCombox);
|
||||
ConfigParser.LoadGuiElement(ffEncPreset);
|
||||
ConfigParser.LoadGuiElement(ffEncArgs);
|
||||
@@ -278,12 +275,6 @@ namespace Flowframes.Forms
|
||||
ConfigParser.SaveGuiElement(custOutDir);
|
||||
}
|
||||
|
||||
private void cmdDebugMode_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_initialized && cmdDebugMode.SelectedIndex == 2)
|
||||
UiUtils.ShowMessageBox("If you enable this, you need to close the CMD window manually after the process has finished, otherwise processing will be paused!", UiUtils.MessageType.Warning);
|
||||
}
|
||||
|
||||
private void dedupMode_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
magickDedupePanel.Visible = false; // dedupMode.SelectedIndex == 2;
|
||||
|
||||
@@ -120,6 +120,9 @@
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="info1.ToolTip" xml:space="preserve">
|
||||
<value>Set the filename patterns using placeholders:
|
||||
[NAME] for the input filename
|
||||
|
||||
@@ -317,7 +317,6 @@ namespace Flowframes.IO
|
||||
autoEncSafeBufferCuda,
|
||||
autoEncSafeBufferNcnn,
|
||||
clearLogOnInput,
|
||||
cmdDebugMode,
|
||||
compressedPyVersion,
|
||||
customServer,
|
||||
dainNcnnTilesize,
|
||||
|
||||
@@ -39,7 +39,6 @@ namespace Flowframes
|
||||
if (!Utils.CheckAiAvailable(currentSettings.ai, currentSettings.model)) return; // Check if selected AI pkg is installed
|
||||
if (!AutoEncodeResume.resumeNextRun && !Utils.CheckDeleteOldTempFolder()) return; // Try to delete temp folder if an old one exists
|
||||
if (!(await Utils.CheckEncoderValid())) return; // Check encoder compat
|
||||
Utils.ShowWarnings(currentSettings.interpFactor, currentSettings.ai);
|
||||
currentSettings.stepByStep = false;
|
||||
Program.mainForm.Invoke(() => Program.mainForm.SetStatus("Starting..."));
|
||||
sw.Restart();
|
||||
|
||||
@@ -202,12 +202,6 @@ namespace Flowframes.Main
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void ShowWarnings(float factor, AiInfo ai)
|
||||
{
|
||||
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 (path.StartsWith(@"\\"))
|
||||
@@ -301,12 +295,6 @@ namespace Flowframes.Main
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Config.GetInt(Config.Key.cmdDebugMode) > 0)
|
||||
{
|
||||
Logger.Log($"Not Using AutoEnc: CMD window is shown (cmdDebugMode > 0)", true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (current.outSettings.Format == Enums.Output.Format.Gif)
|
||||
{
|
||||
Logger.Log($"Not Using AutoEnc: Using GIF output", true);
|
||||
|
||||
@@ -59,9 +59,8 @@ namespace Flowframes
|
||||
|
||||
public static async Task<string> RunFfmpeg(string args, string workingDir, LogMode logMode, string loglevel, bool reliableOutput = true, bool progressBar = false)
|
||||
{
|
||||
bool show = Config.GetInt(Config.Key.cmdDebugMode) > 0;
|
||||
string processOutput = "";
|
||||
Process ffmpeg = OsUtils.NewProcess(!show);
|
||||
Process ffmpeg = OsUtils.NewProcess(true);
|
||||
NmkdStopwatch timeSinceLastOutput = new NmkdStopwatch();
|
||||
lastAvProcess = ffmpeg;
|
||||
|
||||
@@ -78,21 +77,12 @@ namespace Flowframes
|
||||
if (logMode != LogMode.Hidden) Logger.Log("Running FFmpeg...", false);
|
||||
Logger.Log($"ffmpeg {beforeArgs} {args}", true, false, "ffmpeg");
|
||||
|
||||
if (!show)
|
||||
{
|
||||
ffmpeg.OutputDataReceived += (sender, outLine) => { AvOutputHandler.LogOutput(outLine.Data, ref processOutput, "ffmpeg", logMode, progressBar); timeSinceLastOutput.Sw.Restart(); };
|
||||
ffmpeg.ErrorDataReceived += (sender, outLine) => { AvOutputHandler.LogOutput(outLine.Data, ref processOutput, "ffmpeg", logMode, progressBar); timeSinceLastOutput.Sw.Restart(); };
|
||||
}
|
||||
|
||||
ffmpeg.OutputDataReceived += (sender, outLine) => { AvOutputHandler.LogOutput(outLine.Data, ref processOutput, "ffmpeg", logMode, progressBar); timeSinceLastOutput.Sw.Restart(); };
|
||||
ffmpeg.ErrorDataReceived += (sender, outLine) => { AvOutputHandler.LogOutput(outLine.Data, ref processOutput, "ffmpeg", logMode, progressBar); timeSinceLastOutput.Sw.Restart(); };
|
||||
ffmpeg.Start();
|
||||
ffmpeg.PriorityClass = ProcessPriorityClass.BelowNormal;
|
||||
|
||||
if (!show)
|
||||
{
|
||||
ffmpeg.BeginOutputReadLine();
|
||||
ffmpeg.BeginErrorReadLine();
|
||||
}
|
||||
|
||||
ffmpeg.BeginOutputReadLine();
|
||||
ffmpeg.BeginErrorReadLine();
|
||||
while (!ffmpeg.HasExited) await Task.Delay(10);
|
||||
while (reliableOutput && timeSinceLastOutput.ElapsedMs < 200) await Task.Delay(50);
|
||||
|
||||
@@ -149,10 +139,8 @@ namespace Flowframes
|
||||
|
||||
public static async Task<string> RunFfprobe(FfprobeSettings settings, bool asyncOutput = false)
|
||||
{
|
||||
bool show = Config.GetInt(Config.Key.cmdDebugMode) > 0;
|
||||
|
||||
string processOutput = "";
|
||||
Process ffprobe = OsUtils.NewProcess(!show);
|
||||
Process ffprobe = OsUtils.NewProcess(true);
|
||||
NmkdStopwatch timeSinceLastOutput = new NmkdStopwatch();
|
||||
|
||||
bool concat = settings.Args.Split(" \"").Last().Remove("\"").Trim().EndsWith(".concat");
|
||||
@@ -165,21 +153,13 @@ namespace Flowframes
|
||||
if (!asyncOutput)
|
||||
return await Task.Run(() => OsUtils.GetProcStdOut(ffprobe));
|
||||
|
||||
if (!show)
|
||||
{
|
||||
string[] ignore = new string[0];
|
||||
ffprobe.OutputDataReceived += (sender, outLine) => { processOutput += outLine + Environment.NewLine; };
|
||||
ffprobe.ErrorDataReceived += (sender, outLine) => { processOutput += outLine + Environment.NewLine; };
|
||||
}
|
||||
|
||||
string[] ignore = new string[0];
|
||||
ffprobe.OutputDataReceived += (sender, outLine) => { processOutput += outLine + Environment.NewLine; };
|
||||
ffprobe.ErrorDataReceived += (sender, outLine) => { processOutput += outLine + Environment.NewLine; };
|
||||
ffprobe.Start();
|
||||
ffprobe.PriorityClass = ProcessPriorityClass.BelowNormal;
|
||||
|
||||
if (!show)
|
||||
{
|
||||
ffprobe.BeginOutputReadLine();
|
||||
ffprobe.BeginErrorReadLine();
|
||||
}
|
||||
ffprobe.BeginOutputReadLine();
|
||||
ffprobe.BeginErrorReadLine();
|
||||
|
||||
while (!ffprobe.HasExited) await Task.Delay(10);
|
||||
while (timeSinceLastOutput.ElapsedMs < 200) await Task.Delay(50);
|
||||
|
||||
@@ -212,27 +212,19 @@ namespace Flowframes.Os
|
||||
string prec = Config.GetBool(Config.Key.rifeCudaFp16) ? "--fp16" : "";
|
||||
string args = $" --input {inPath.Wrap()} --output {outDir} --model {mdl} --multi {interpFactor} {uhdStr} {wthreads} {rbuffer} {prec}";
|
||||
|
||||
Process rifePy = OsUtils.NewProcess(!OsUtils.ShowHiddenCmd());
|
||||
Process rifePy = OsUtils.NewProcess(true);
|
||||
AiStarted(rifePy, 3500);
|
||||
SetProgressCheck(Path.Combine(Interpolate.currentSettings.tempFolder, outDir), interpFactor);
|
||||
rifePy.StartInfo.Arguments = $"{OsUtils.GetCmdArg()} cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.rifeCuda.PkgDir).Wrap()} & " +
|
||||
rifePy.StartInfo.Arguments = $"/C cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.rifeCuda.PkgDir).Wrap()} & " +
|
||||
$"set CUDA_VISIBLE_DEVICES={Config.Get(Config.Key.torchGpus)} & {Python.GetPyCmd()} {script} {args}";
|
||||
Logger.Log($"Running RIFE (CUDA){(InterpolateUtils.UseUhd() ? " (UHD Mode)" : "")}...", false);
|
||||
Logger.Log("cmd.exe " + rifePy.StartInfo.Arguments, true);
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
rifePy.OutputDataReceived += (sender, outLine) => { LogOutput(outLine.Data, Implementations.rifeCuda); };
|
||||
rifePy.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.rifeCuda, true); };
|
||||
}
|
||||
|
||||
rifePy.OutputDataReceived += (sender, outLine) => { LogOutput(outLine.Data, Implementations.rifeCuda); };
|
||||
rifePy.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.rifeCuda, true); };
|
||||
rifePy.Start();
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
rifePy.BeginOutputReadLine();
|
||||
rifePy.BeginErrorReadLine();
|
||||
}
|
||||
rifePy.BeginOutputReadLine();
|
||||
rifePy.BeginErrorReadLine();
|
||||
|
||||
while (!rifePy.HasExited) await Task.Delay(1);
|
||||
}
|
||||
@@ -272,27 +264,19 @@ namespace Flowframes.Os
|
||||
Directory.CreateDirectory(outPath);
|
||||
string args = $" --input {inPath.Wrap()} --output {outPath.Wrap()} --model {mdl}/{mdl}.pth --factor {interpFactor}";
|
||||
|
||||
Process flavrPy = OsUtils.NewProcess(!OsUtils.ShowHiddenCmd());
|
||||
Process flavrPy = OsUtils.NewProcess(true);
|
||||
AiStarted(flavrPy, 4000);
|
||||
SetProgressCheck(Path.Combine(Interpolate.currentSettings.tempFolder, outDir), interpFactor);
|
||||
flavrPy.StartInfo.Arguments = $"{OsUtils.GetCmdArg()} cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.flavrCuda.PkgDir).Wrap()} & " +
|
||||
flavrPy.StartInfo.Arguments = $"/C cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.flavrCuda.PkgDir).Wrap()} & " +
|
||||
$"set CUDA_VISIBLE_DEVICES={Config.Get(Config.Key.torchGpus)} & {Python.GetPyCmd()} {script} {args}";
|
||||
Logger.Log($"Running FLAVR (CUDA)...", false);
|
||||
Logger.Log("cmd.exe " + flavrPy.StartInfo.Arguments, true);
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
flavrPy.OutputDataReceived += (sender, outLine) => { LogOutput(outLine.Data, Implementations.flavrCuda); };
|
||||
flavrPy.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.flavrCuda, true); };
|
||||
}
|
||||
|
||||
flavrPy.OutputDataReceived += (sender, outLine) => { LogOutput(outLine.Data, Implementations.flavrCuda); };
|
||||
flavrPy.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.flavrCuda, true); };
|
||||
flavrPy.Start();
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
flavrPy.BeginOutputReadLine();
|
||||
flavrPy.BeginErrorReadLine();
|
||||
}
|
||||
flavrPy.BeginOutputReadLine();
|
||||
flavrPy.BeginErrorReadLine();
|
||||
|
||||
while (!flavrPy.HasExited) await Task.Delay(1);
|
||||
}
|
||||
@@ -322,7 +306,7 @@ namespace Flowframes.Os
|
||||
{
|
||||
Directory.CreateDirectory(outPath);
|
||||
string logFileName = "rife-ncnn-log";
|
||||
Process rifeNcnn = OsUtils.NewProcess(!OsUtils.ShowHiddenCmd());
|
||||
Process rifeNcnn = OsUtils.NewProcess(true);
|
||||
AiStarted(rifeNcnn, 1500, inPath);
|
||||
SetProgressCheck(outPath, factor);
|
||||
int targetFrames = ((IoUtils.GetAmountOfFiles(lastInPath, false, "*.*") * factor).RoundToInt()); // TODO: Maybe won't work with fractional factors ??
|
||||
@@ -331,24 +315,16 @@ namespace Flowframes.Os
|
||||
string uhdStr = InterpolateUtils.UseUhd() ? "-u" : "";
|
||||
string ttaStr = Config.GetBool(Config.Key.rifeNcnnUseTta, false) ? "-x" : "";
|
||||
|
||||
rifeNcnn.StartInfo.Arguments = $"{OsUtils.GetCmdArg()} cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.rifeNcnn.PkgDir).Wrap()} & rife-ncnn-vulkan.exe " +
|
||||
rifeNcnn.StartInfo.Arguments = $"/C cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.rifeNcnn.PkgDir).Wrap()} & rife-ncnn-vulkan.exe " +
|
||||
$" -v -i {inPath.Wrap()} -o {outPath.Wrap()} {frames} -m {mdl.Lower()} {ttaStr} {uhdStr} -g {NcnnGpuIds} -f {NcnnUtils.GetNcnnPattern()} -j {NcnnUtils.GetNcnnThreads(Implementations.rifeNcnn)}";
|
||||
|
||||
Logger.Log("cmd.exe " + rifeNcnn.StartInfo.Arguments, true);
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
rifeNcnn.OutputDataReceived += (sender, outLine) => { LogOutput("[O] " + outLine.Data, Implementations.rifeNcnn); };
|
||||
rifeNcnn.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.rifeNcnn, true); };
|
||||
}
|
||||
|
||||
rifeNcnn.OutputDataReceived += (sender, outLine) => { LogOutput("[O] " + outLine.Data, Implementations.rifeNcnn); };
|
||||
rifeNcnn.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.rifeNcnn, true); };
|
||||
rifeNcnn.Start();
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
rifeNcnn.BeginOutputReadLine();
|
||||
rifeNcnn.BeginErrorReadLine();
|
||||
}
|
||||
rifeNcnn.BeginOutputReadLine();
|
||||
rifeNcnn.BeginErrorReadLine();
|
||||
|
||||
while (!rifeNcnn.HasExited) await Task.Delay(1);
|
||||
}
|
||||
@@ -377,7 +353,7 @@ namespace Flowframes.Os
|
||||
static async Task RunRifeNcnnVsProcess(string inPath, float factor, string outPath, string mdl, Size res, bool rt = false)
|
||||
{
|
||||
IoUtils.CreateDir(outPath);
|
||||
Process rifeNcnnVs = OsUtils.NewProcess(!OsUtils.ShowHiddenCmd());
|
||||
Process rifeNcnnVs = OsUtils.NewProcess(true);
|
||||
string avDir = Path.Combine(Paths.GetPkgPath(), Paths.audioVideoDir);
|
||||
string pkgDir = Path.Combine(Paths.GetPkgPath(), Implementations.rifeNcnnVs.PkgDir);
|
||||
int gpuId = NcnnGpuIds.Split(',')[0].GetInt();
|
||||
@@ -415,7 +391,7 @@ namespace Flowframes.Os
|
||||
IoUtils.TryDeleteIfExists(Path.Combine(Interpolate.currentSettings.tempFolder, "alpha.mkv"));
|
||||
string vspipe = $"vspipe rife.py {VapourSynthUtils.GetVsPipeArgs(vsSettings)}";
|
||||
string ffmpeg = $"{Path.Combine(avDir, "ffmpeg").Wrap()} -loglevel warning -stats -y";
|
||||
string baseArgs = $"{OsUtils.GetCmdArg()} cd /D {pkgDir.Wrap()}";
|
||||
string baseArgs = $"/C cd /D {pkgDir.Wrap()}";
|
||||
|
||||
if (vsSettings.Alpha)
|
||||
{
|
||||
@@ -460,7 +436,7 @@ namespace Flowframes.Os
|
||||
{
|
||||
string dainDir = Path.Combine(Paths.GetPkgPath(), Implementations.dainNcnn.PkgDir);
|
||||
Directory.CreateDirectory(outPath);
|
||||
Process dain = OsUtils.NewProcess(!OsUtils.ShowHiddenCmd());
|
||||
Process dain = OsUtils.NewProcess(true);
|
||||
AiStarted(dain, 1500);
|
||||
SetProgressCheck(outPath, factor);
|
||||
int targetFrames = ((IoUtils.GetAmountOfFiles(lastInPath, false, "*.*") * factor).RoundToInt());
|
||||
@@ -468,23 +444,15 @@ namespace Flowframes.Os
|
||||
string args = $" -v -i {framesPath.Wrap()} -o {outPath.Wrap()} -n {targetFrames} -m {mdl.Lower()}" +
|
||||
$" -t {NcnnUtils.GetNcnnTilesize(tilesize)} -g {NcnnGpuIds} -f {NcnnUtils.GetNcnnPattern()} -j 2:1:2";
|
||||
|
||||
dain.StartInfo.Arguments = $"{OsUtils.GetCmdArg()} cd /D {dainDir.Wrap()} & dain-ncnn-vulkan.exe {args}";
|
||||
dain.StartInfo.Arguments = $"/C cd /D {dainDir.Wrap()} & dain-ncnn-vulkan.exe {args}";
|
||||
Logger.Log("Running DAIN...", false);
|
||||
Logger.Log("cmd.exe " + dain.StartInfo.Arguments, true);
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
dain.OutputDataReceived += (sender, outLine) => { LogOutput("[O] " + outLine.Data, Implementations.dainNcnn); };
|
||||
dain.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.dainNcnn, true); };
|
||||
}
|
||||
|
||||
dain.OutputDataReceived += (sender, outLine) => { LogOutput("[O] " + outLine.Data, Implementations.dainNcnn); };
|
||||
dain.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.dainNcnn, true); };
|
||||
dain.Start();
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
dain.BeginOutputReadLine();
|
||||
dain.BeginErrorReadLine();
|
||||
}
|
||||
dain.BeginOutputReadLine();
|
||||
dain.BeginErrorReadLine();
|
||||
|
||||
while (!dain.HasExited)
|
||||
await Task.Delay(100);
|
||||
@@ -529,27 +497,19 @@ namespace Flowframes.Os
|
||||
string args = $" --custom_path {basePath.Wrap()} --input {inPath.Wrap()} --output {outPath.Wrap()} --mdl_dir {mdlDir}" +
|
||||
$" --multiple {interpFactor} --gpu 0 {mdlArgs}";
|
||||
|
||||
Process xvfiPy = OsUtils.NewProcess(!OsUtils.ShowHiddenCmd());
|
||||
Process xvfiPy = OsUtils.NewProcess(true);
|
||||
AiStarted(xvfiPy, 3500);
|
||||
SetProgressCheck(Path.Combine(Interpolate.currentSettings.tempFolder, outDir), interpFactor);
|
||||
xvfiPy.StartInfo.Arguments = $"{OsUtils.GetCmdArg()} cd /D {pkgPath.Wrap()} & " +
|
||||
xvfiPy.StartInfo.Arguments = $"/C cd /D {pkgPath.Wrap()} & " +
|
||||
$"set CUDA_VISIBLE_DEVICES={Config.Get(Config.Key.torchGpus)} & {Python.GetPyCmd()} {script} {args}";
|
||||
Logger.Log($"Running XVFI (CUDA)...", false);
|
||||
Logger.Log("cmd.exe " + xvfiPy.StartInfo.Arguments, true);
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
xvfiPy.OutputDataReceived += (sender, outLine) => { LogOutput(outLine.Data, Implementations.xvfiCuda); };
|
||||
xvfiPy.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.xvfiCuda, true); };
|
||||
}
|
||||
|
||||
xvfiPy.OutputDataReceived += (sender, outLine) => { LogOutput(outLine.Data, Implementations.xvfiCuda); };
|
||||
xvfiPy.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.xvfiCuda, true); };
|
||||
xvfiPy.Start();
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
xvfiPy.BeginOutputReadLine();
|
||||
xvfiPy.BeginErrorReadLine();
|
||||
}
|
||||
xvfiPy.BeginOutputReadLine();
|
||||
xvfiPy.BeginErrorReadLine();
|
||||
|
||||
while (!xvfiPy.HasExited) await Task.Delay(1);
|
||||
}
|
||||
@@ -579,7 +539,7 @@ namespace Flowframes.Os
|
||||
static async Task RunIfrnetNcnnProcess(string inPath, float factor, string outPath, string mdl)
|
||||
{
|
||||
Directory.CreateDirectory(outPath);
|
||||
Process ifrnetNcnn = OsUtils.NewProcess(!OsUtils.ShowHiddenCmd());
|
||||
Process ifrnetNcnn = OsUtils.NewProcess(true);
|
||||
AiStarted(ifrnetNcnn, 1500, inPath);
|
||||
SetProgressCheck(outPath, factor);
|
||||
//int targetFrames = ((IoUtils.GetAmountOfFiles(lastInPath, false, "*.*") * factor).RoundToInt()); // TODO: Maybe won't work with fractional factors ??
|
||||
@@ -587,24 +547,16 @@ namespace Flowframes.Os
|
||||
string uhdStr = ""; // InterpolateUtils.UseUhd() ? "-u" : "";
|
||||
string ttaStr = ""; // Config.GetBool(Config.Key.rifeNcnnUseTta, false) ? "-x" : "";
|
||||
|
||||
ifrnetNcnn.StartInfo.Arguments = $"{OsUtils.GetCmdArg()} cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.ifrnetNcnn.PkgDir).Wrap()} & ifrnet-ncnn-vulkan.exe " +
|
||||
ifrnetNcnn.StartInfo.Arguments = $"/C cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.ifrnetNcnn.PkgDir).Wrap()} & ifrnet-ncnn-vulkan.exe " +
|
||||
$" -v -i {inPath.Wrap()} -o {outPath.Wrap()} -m {mdl} {ttaStr} {uhdStr} -g {NcnnGpuIds} -f {NcnnUtils.GetNcnnPattern()} -j {NcnnUtils.GetNcnnThreads(Implementations.ifrnetNcnn)}";
|
||||
|
||||
Logger.Log("cmd.exe " + ifrnetNcnn.StartInfo.Arguments, true);
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
ifrnetNcnn.OutputDataReceived += (sender, outLine) => { LogOutput("[O] " + outLine.Data, Implementations.ifrnetNcnn); };
|
||||
ifrnetNcnn.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.ifrnetNcnn, true); };
|
||||
}
|
||||
|
||||
ifrnetNcnn.OutputDataReceived += (sender, outLine) => { LogOutput("[O] " + outLine.Data, Implementations.ifrnetNcnn); };
|
||||
ifrnetNcnn.ErrorDataReceived += (sender, outLine) => { LogOutput("[E] " + outLine.Data, Implementations.ifrnetNcnn, true); };
|
||||
ifrnetNcnn.Start();
|
||||
|
||||
if (!OsUtils.ShowHiddenCmd())
|
||||
{
|
||||
ifrnetNcnn.BeginOutputReadLine();
|
||||
ifrnetNcnn.BeginErrorReadLine();
|
||||
}
|
||||
ifrnetNcnn.BeginOutputReadLine();
|
||||
ifrnetNcnn.BeginErrorReadLine();
|
||||
|
||||
while (!ifrnetNcnn.HasExited) await Task.Delay(1);
|
||||
}
|
||||
|
||||
@@ -127,21 +127,6 @@ namespace Flowframes.Os
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetCmdArg()
|
||||
{
|
||||
bool stayOpen = Config.GetInt(Config.Key.cmdDebugMode) == 2;
|
||||
|
||||
if (stayOpen)
|
||||
return "/K";
|
||||
else
|
||||
return "/C";
|
||||
}
|
||||
|
||||
public static bool ShowHiddenCmd()
|
||||
{
|
||||
return Config.GetInt(Config.Key.cmdDebugMode) > 0;
|
||||
}
|
||||
|
||||
public static bool DriveIsSSD(string path)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user