diff --git a/Code/Form1.cs b/Code/Form1.cs index 1c8ddfd..f8c630f 100644 --- a/Code/Form1.cs +++ b/Code/Form1.cs @@ -365,9 +365,9 @@ namespace Flowframes { stepSelector.Items.Clear(); if(Config.GetBool("scnDetect")) - stepSelector.Items.AddRange(new string[] { "1) Extract Scene Changes", "2) Extract Video Frames", "3) Run Interpolation", "4) Create Output Video", "5) Cleanup & Reset" }); + stepSelector.Items.AddRange(new string[] { "1) Extract Scene Changes", "2) Import/Extract Video Frames", "3) Run Interpolation", "4) Create Output Video", "5) Cleanup & Reset" }); else - stepSelector.Items.AddRange(new string[] { "1) Extract Video Frames", "2) Run Interpolation", "3) Create Output Video", "4) Cleanup & Reset" }); + stepSelector.Items.AddRange(new string[] { "1) Import/Extract Video Frames", "2) Run Interpolation", "3) Create Output Video", "4) Cleanup & Reset" }); stepSelector.SelectedIndex = 0; bool stepByStep = Config.GetInt("processingMode") == 1; stepSelector.Visible = stepByStep; diff --git a/Code/Main/InterpolateSteps.cs b/Code/Main/InterpolateSteps.cs index 675a8c3..71530c9 100644 --- a/Code/Main/InterpolateSteps.cs +++ b/Code/Main/InterpolateSteps.cs @@ -29,13 +29,27 @@ namespace Flowframes.Main InitState(); if (step.Contains("Extract Scene Changes")) - await ExtractSceneChanges(); + { + if (!currentInputIsFrames) // Input is video - extract frames first + await ExtractSceneChanges(); + else + InterpolateUtils.ShowMessage("Scene changes can only be extracted from videos, not frames!", "Error"); + } + if (step.Contains("Extract Video Frames")) - await ExtractVideoFrames(); + { + if (!currentInputIsFrames) // Input is video - extract frames first + await ExtractVideoFrames(); + else + await FFmpegCommands.ImportImages(currentInPath, currentFramesPath); + } + if (step.Contains("Run Interpolation")) await DoInterpolate(); + if (step.Contains("Create Output Video")) await CreateOutputVid(); + if (step.Contains("Cleanup")) await Reset(); @@ -62,6 +76,8 @@ namespace Flowframes.Main currentFramesPath = Path.Combine(currentTempDir, Paths.framesDir); currentInterpFramesDir = Path.Combine(currentTempDir, Paths.interpDir); + + currentInputIsFrames = IOUtils.IsPathDirectory(currentInPath); } public static async Task ExtractSceneChanges ()