mirror of
https://github.com/n00mkrad/flowframes.git
synced 2026-09-01 19:51:28 +02:00
Removed input file extension restriction, better err handling for frame extraction
This commit is contained in:
@@ -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...");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user