Removed input file extension restriction, better err handling for frame extraction

This commit is contained in:
N00MKRAD
2020-12-13 23:44:23 +01:00
parent 151a909883
commit e7dae90c92
3 changed files with 18 additions and 7 deletions

View File

@@ -23,9 +23,13 @@ namespace Flowframes.Magick
public static async Task Run(string path, bool testRun = false, bool setStatus = true)
{
if (path == null || !Directory.Exists(path) || Interpolate.canceled)
return;
currentMode = Mode.Auto;
Program.mainForm.SetStatus("Running frame de-duplication");
if(setStatus)
Program.mainForm.SetStatus("Running frame de-duplication");
currentThreshold = Config.GetFloat("dedupThresh");
Logger.Log("Running accurate frame de-duplication...");

View File

@@ -148,8 +148,15 @@ namespace Flowframes
{
if (canceled) return;
if (!Directory.Exists(currentFramesPath) || currentInputFrameCount <= 0 || IOUtils.GetAmountOfFiles(currentFramesPath, false, "*.png") < 2)
Cancel("Extracted frames folder is empty!");
int extractedFrames = IOUtils.GetAmountOfFiles(currentFramesPath, false, "*.png");
if (!Directory.Exists(currentFramesPath) || currentInputFrameCount <= 0 || extractedFrames < 2)
{
if(extractedFrames == 1)
Cancel("Only a single frame was extracted from your input file!\n\nPossibly your input is an image, not a video?");
else
Cancel("Frame extraction failed!\n\nYour input file might be incompatible.");
}
if (Config.GetInt("dedupMode") == 1)
await MagickDedupe.Run(currentFramesPath);

View File

@@ -239,10 +239,10 @@ namespace Flowframes.Main
{
if (videoPath == null || !IOUtils.IsFileValid(videoPath))
return false;
string ext = Path.GetExtension(videoPath).ToLower();
if (Formats.supported.Contains(ext))
return true;
return false;
// string ext = Path.GetExtension(videoPath).ToLower();
// if (!Formats.supported.Contains(ext))
// return false;
return true;
}
public static string GetExt(i.OutMode format)