Added frame import support to SBS mode

This commit is contained in:
N00MKRAD
2020-12-02 14:36:41 +01:00
parent e6cfa68a2a
commit 2c061317d3
2 changed files with 20 additions and 4 deletions

View File

@@ -365,9 +365,9 @@ namespace Flowframes
{ {
stepSelector.Items.Clear(); stepSelector.Items.Clear();
if(Config.GetBool("scnDetect")) 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 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; stepSelector.SelectedIndex = 0;
bool stepByStep = Config.GetInt("processingMode") == 1; bool stepByStep = Config.GetInt("processingMode") == 1;
stepSelector.Visible = stepByStep; stepSelector.Visible = stepByStep;

View File

@@ -29,13 +29,27 @@ namespace Flowframes.Main
InitState(); InitState();
if (step.Contains("Extract Scene Changes")) if (step.Contains("Extract Scene Changes"))
{
if (!currentInputIsFrames) // Input is video - extract frames first
await ExtractSceneChanges(); await ExtractSceneChanges();
else
InterpolateUtils.ShowMessage("Scene changes can only be extracted from videos, not frames!", "Error");
}
if (step.Contains("Extract Video Frames")) if (step.Contains("Extract Video Frames"))
{
if (!currentInputIsFrames) // Input is video - extract frames first
await ExtractVideoFrames(); await ExtractVideoFrames();
else
await FFmpegCommands.ImportImages(currentInPath, currentFramesPath);
}
if (step.Contains("Run Interpolation")) if (step.Contains("Run Interpolation"))
await DoInterpolate(); await DoInterpolate();
if (step.Contains("Create Output Video")) if (step.Contains("Create Output Video"))
await CreateOutputVid(); await CreateOutputVid();
if (step.Contains("Cleanup")) if (step.Contains("Cleanup"))
await Reset(); await Reset();
@@ -62,6 +76,8 @@ namespace Flowframes.Main
currentFramesPath = Path.Combine(currentTempDir, Paths.framesDir); currentFramesPath = Path.Combine(currentTempDir, Paths.framesDir);
currentInterpFramesDir = Path.Combine(currentTempDir, Paths.interpDir); currentInterpFramesDir = Path.Combine(currentTempDir, Paths.interpDir);
currentInputIsFrames = IOUtils.IsPathDirectory(currentInPath);
} }
public static async Task ExtractSceneChanges () public static async Task ExtractSceneChanges ()