From 4ea676c405604be9c12f55f0b3cc3dc9e9b1848e Mon Sep 17 00:00:00 2001 From: N00MKRAD <61149547+n00mkrad@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:42:27 +0200 Subject: [PATCH] CLI: --loop, --fix_scene_changes, --scene_change_sensitivity, --max_fps --- CodeLegacy/Forms/Main/Form1.cs | 20 ++++++++++++++++++++ CodeLegacy/Program.cs | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/CodeLegacy/Forms/Main/Form1.cs b/CodeLegacy/Forms/Main/Form1.cs index cd1b554..eeb9bf9 100644 --- a/CodeLegacy/Forms/Main/Form1.cs +++ b/CodeLegacy/Forms/Main/Form1.cs @@ -227,6 +227,26 @@ namespace Flowframes.Forms.Main { Config.Set(Config.Key.maxVidHeight, Program.Cli.MaxHeight.ToString()); } + + if (Program.Cli.Loop != null) + { + Config.Set(Config.Key.enableLoop, ((bool)Program.Cli.Loop).ToString()); + } + + if (Program.Cli.FixSceneChanges != null) + { + Config.Set(Config.Key.scnDetect, ((bool)Program.Cli.Loop).ToString()); + } + + if (Program.Cli.FixSceneChangeVal > 0f) + { + Config.Set(Config.Key.scnDetectValue, Program.Cli.FixSceneChangeVal.ToString()); + } + + if (Program.Cli.MaxOutFps >= 1f) + { + Config.Set(Config.Key.maxFps, Program.Cli.MaxOutFps.ToString()); + } } void RemovePreviewIfDisabled() diff --git a/CodeLegacy/Program.cs b/CodeLegacy/Program.cs index aaff595..556adb4 100644 --- a/CodeLegacy/Program.cs +++ b/CodeLegacy/Program.cs @@ -48,6 +48,10 @@ namespace Flowframes public static string InterpModel = ""; public static string OutputDir = ""; public static int MaxHeight = -1; + public static bool? Loop = false; + public static bool? FixSceneChanges = false; + public static float FixSceneChangeVal = -1f; + public static float MaxOutFps = -1f; public static List ValidFiles = new List(); } @@ -135,6 +139,22 @@ namespace Flowframes "h|max_height=", $"Max video size (pixels height). Larger videos will be downscaled.", v => Cli.MaxHeight = v.GetInt() }, + { + "l|loop", $"Enable loop output mode", + v => Cli.Loop = v != null ? true : (bool?)null + }, + { + "scn|fix_scene_changes", $"Do not interpolate scene cuts to avoid artifacts", + v => Cli.FixSceneChanges = v != null ? true : (bool?)null + }, + { + "scnv|scene_change_sensitivity=", $"Scene change sensitivity, lower is more sensitive (e.g. 0.18)", + v => Cli.FixSceneChangeVal = v.GetFloat() + }, + { + "fps|max_fps=", $"Maximum FPS of output video, if the interpolation factor results in a higher FPS, it will be reduced to this value", + v => Cli.MaxOutFps = v.GetFloat() + }, { "o|output_dir=", "Output folder to save the interpolated video in", v => Cli.OutputDir = v.Trim()