Check GIF max framerate, minor QOL & logging improvements

This commit is contained in:
N00MKRAD
2021-01-07 12:15:13 +01:00
parent dc9035caa1
commit 124aa6bfb4
9 changed files with 36 additions and 19 deletions

View File

@@ -36,7 +36,7 @@ namespace Flowframes
public static async Task Start()
{
canceled = false;
if (!Utils.InputIsValid(current.inPath, current.outPath, current.outFps, current.interpFactor, current.tilesize)) return; // General input checks
if (!Utils.InputIsValid(current.inPath, current.outPath, current.outFps, current.interpFactor, current.tilesize, current.outMode)) return; // General input checks
if (!Utils.CheckAiAvailable(current.ai)) return; // Check if selected AI pkg is installed
if (!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

View File

@@ -30,7 +30,7 @@ namespace Flowframes.Main
Program.mainForm.SetWorking(true);
current = Program.mainForm.GetCurrentSettings();
if (!InterpolateUtils.InputIsValid(current.inPath, current.outPath, current.outFps, current.interpFactor, current.tilesize)) return; // General input checks
if (!InterpolateUtils.InputIsValid(current.inPath, current.outPath, current.outFps, current.interpFactor, current.tilesize, current.outMode)) return; // General input checks
if (step.Contains("Extract Scene Changes"))
{

View File

@@ -176,7 +176,7 @@ namespace Flowframes.Main
return Path.Combine(basePath, Path.GetFileNameWithoutExtension(inPath).StripBadChars().Remove(" ").Trunc(30, false) + "-temp");
}
public static bool InputIsValid(string inDir, string outDir, float fpsOut, int interp, int tilesize)
public static bool InputIsValid(string inDir, string outDir, float fpsOut, int interp, int tilesize, Interpolate.OutMode outMode)
{
bool passes = true;
@@ -197,9 +197,14 @@ namespace Flowframes.Main
ShowMessage("Interpolation factor is not valid!");
passes = false;
}
if (passes && outMode == i.OutMode.VidGif && fpsOut >= 50)
{
ShowMessage("Invalid output frame rate!\nGIF does not properly support frame rates above 40 FPS.\nPlease use MP4, WEBM or another video format.");
passes = false;
}
if (passes && fpsOut < 1 || fpsOut > 500)
{
ShowMessage("Invalid target frame rate - Must be 1-500.");
ShowMessage("Invalid output frame rate - Must be 1-500.");
passes = false;
}
if (passes && tilesize % 32 != 0 || tilesize < 128)