mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-25 12:49:26 +01:00
Don't run scene detection when extracting frames in SBS mode
This commit is contained in:
@@ -49,7 +49,7 @@ namespace Flowframes
|
||||
await GetFrames();
|
||||
if (canceled) return;
|
||||
sw.Restart();
|
||||
await PostProcessFrames();
|
||||
await PostProcessFrames(false);
|
||||
}
|
||||
|
||||
if (canceled) return;
|
||||
@@ -69,12 +69,12 @@ namespace Flowframes
|
||||
Program.mainForm.SetStatus("Done interpolating!");
|
||||
}
|
||||
|
||||
public static async Task GetFrames ()
|
||||
public static async Task GetFrames (bool stepByStep = false)
|
||||
{
|
||||
current.RefreshAlpha();
|
||||
|
||||
if (!current.inputIsFrames) // Input is video - extract frames first
|
||||
await ExtractFrames(current.inPath, current.framesFolder, current.alpha);
|
||||
if (!current.inputIsFrames) // Extract if input is video, import if image sequence
|
||||
await ExtractFrames(current.inPath, current.framesFolder, current.alpha, !stepByStep);
|
||||
else
|
||||
await FfmpegExtract.ImportImages(current.inPath, current.framesFolder, current.alpha, await Utils.GetOutputResolution(current.inPath, true));
|
||||
|
||||
@@ -88,9 +88,9 @@ namespace Flowframes
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task ExtractFrames(string inPath, string outPath, bool alpha, bool extractAudio = true)
|
||||
public static async Task ExtractFrames(string inPath, string outPath, bool alpha, bool sceneDetect)
|
||||
{
|
||||
if (Config.GetBool("scnDetect"))
|
||||
if (sceneDetect && Config.GetBool("scnDetect"))
|
||||
{
|
||||
Program.mainForm.SetStatus("Extracting scenes from video...");
|
||||
await FfmpegExtract.ExtractSceneChanges(inPath, Path.Combine(current.tempFolder, Paths.scenesDir), current.inFps);
|
||||
@@ -114,21 +114,19 @@ namespace Flowframes
|
||||
if(!Config.GetBool("allowConsecutiveSceneChanges", true))
|
||||
Utils.FixConsecutiveSceneFrames(Path.Combine(current.tempFolder, Paths.scenesDir), current.framesFolder);
|
||||
|
||||
if (extractAudio)
|
||||
{
|
||||
if (canceled) return;
|
||||
Program.mainForm.SetStatus("Extracting audio from video...");
|
||||
string audioFile = Path.Combine(current.tempFolder, "audio");
|
||||
if (audioFile != null && !File.Exists(audioFile))
|
||||
await FfmpegAudioAndMetadata.ExtractAudio(inPath, audioFile);
|
||||
}
|
||||
if (canceled) return;
|
||||
Program.mainForm.SetStatus("Extracting audio from video...");
|
||||
string audioFile = Path.Combine(current.tempFolder, "audio");
|
||||
|
||||
if (audioFile != null && !File.Exists(audioFile))
|
||||
await FfmpegAudioAndMetadata.ExtractAudio(inPath, audioFile);
|
||||
|
||||
if (canceled) return;
|
||||
Program.mainForm.SetStatus("Extracting subtitles from video...");
|
||||
await FfmpegAudioAndMetadata.ExtractSubtitles(inPath, current.tempFolder, current.outMode);
|
||||
}
|
||||
|
||||
public static async Task PostProcessFrames (bool stepByStep = false)
|
||||
public static async Task PostProcessFrames (bool stepByStep)
|
||||
{
|
||||
if (canceled) return;
|
||||
|
||||
|
||||
@@ -37,9 +37,7 @@ namespace Flowframes.Main
|
||||
}
|
||||
|
||||
if (step.Contains("Extract Frames"))
|
||||
{
|
||||
await ExtractFramesStep();
|
||||
}
|
||||
|
||||
if (step.Contains("Run Interpolation"))
|
||||
await DoInterpolate();
|
||||
@@ -79,7 +77,7 @@ namespace Flowframes.Main
|
||||
currentInputFrameCount = await InterpolateUtils.GetInputFrameCountAsync(current.inPath);
|
||||
AiProcess.filenameMap.Clear();
|
||||
|
||||
await GetFrames();
|
||||
await GetFrames(true);
|
||||
}
|
||||
|
||||
public static async Task DoInterpolate()
|
||||
|
||||
Reference in New Issue
Block a user