Don't create timecodes for all factors if step-by-step is not used

This commit is contained in:
N00MKRAD
2020-11-30 20:52:43 +01:00
parent d223351fe6
commit 79fbfd1a6a
3 changed files with 17 additions and 9 deletions

View File

@@ -136,7 +136,7 @@ namespace Flowframes
}
}
public static async Task PostProcessFrames ()
public static async Task PostProcessFrames (bool sbsMode = false)
{
bool firstFrameFix = lastAi.aiName == Networks.rifeCuda.aiName;
@@ -155,8 +155,10 @@ namespace Flowframes
if (canceled) return;
if (Config.GetInt("timingMode") == 1)
await VfrDedupe.CreateTimecodeFiles(currentFramesPath, Config.GetBool("enableLoop"), firstFrameFix);
if(sbsMode)
await VfrDedupe.CreateTimecodeFiles(currentFramesPath, Config.GetBool("enableLoop"), firstFrameFix, -1);
else
await VfrDedupe.CreateTimecodeFiles(currentFramesPath, Config.GetBool("enableLoop"), firstFrameFix, lastInterpFactor);
if (canceled) return;
MagickDedupe.RenameCounterDir(currentFramesPath, "png");

View File

@@ -106,7 +106,7 @@ namespace Flowframes.Main
public static async Task DoInterpolate ()
{
await PostProcessFrames();
await PostProcessFrames(true);
string interpFramesDir = Path.Combine(currentTempDir, Paths.interpDir);
if (!IOUtils.TryDeleteIfExists(interpFramesDir))

View File

@@ -13,13 +13,19 @@ namespace Flowframes.Main
{
class VfrDedupe
{
public static async Task CreateTimecodeFiles(string framesPath, bool loopEnabled, bool firstFrameFix)
public static async Task CreateTimecodeFiles(string framesPath, bool loopEnabled, bool firstFrameFix, int times)
{
Logger.Log("Generating timecodes...");
await CreateTimecodeFile(framesPath, loopEnabled, 2, firstFrameFix);
await CreateTimecodeFile(framesPath, loopEnabled, 4, firstFrameFix);
await CreateTimecodeFile(framesPath, loopEnabled, 8, firstFrameFix);
if(times <= 0)
{
await CreateTimecodeFile(framesPath, loopEnabled, 2, firstFrameFix);
await CreateTimecodeFile(framesPath, loopEnabled, 4, firstFrameFix);
await CreateTimecodeFile(framesPath, loopEnabled, 8, firstFrameFix);
}
else
{
await CreateTimecodeFile(framesPath, loopEnabled, times, firstFrameFix);
}
frameFiles = null;
Logger.Log($"Generating timecodes... Done.", false, true);
}