diff --git a/Code/AudioVideo/FFmpegCommands.cs b/Code/AudioVideo/FFmpegCommands.cs index 29cffda..b3cbee6 100644 --- a/Code/AudioVideo/FFmpegCommands.cs +++ b/Code/AudioVideo/FFmpegCommands.cs @@ -103,7 +103,7 @@ namespace Flowframes string presetStr = $"-preset {Config.Get("ffEncPreset")}"; string vsyncStr = Config.GetInt("vfrMode") == 0 ? "-vsync 1" : "-vsync 2"; string vfrFilename = Path.GetFileName(framesFile); - string args = $" {loopStr} {vsyncStr} -f concat -safe 0 -i {vfrFilename} -r {fps.ToString().Replace(",", ".")} -c:v {enc} -crf {crf} {presetStr} {videoEncArgs} -threads {Config.GetInt("ffEncThreads")} -c:a copy {outPath.Wrap()}"; + string args = $" {loopStr} {vsyncStr} -f concat -r {fps.ToString().Replace(",", ".")} -i {vfrFilename} -c:v {enc} -crf {crf} {presetStr} {videoEncArgs} -threads {Config.GetInt("ffEncThreads")} -c:a copy {outPath.Wrap()}"; await AvProcess.RunFfmpeg(args, framesFile.GetParentDir(), AvProcess.LogMode.OnlyLastLine); } @@ -114,7 +114,7 @@ namespace Flowframes string presetStr = $"-preset {Config.Get("ffEncPreset")}"; string vsyncStr = Config.GetInt("vfrMode") == 0 ? "-vsync 1" : "-vsync 2"; string vfrFilename = Path.GetFileName(framesFile); - string args = $" {vsyncStr} -f concat -safe 0 -i {vfrFilename} -r {fps.ToString().Replace(",", ".")} -c:v {enc} -crf {crf} {presetStr} {videoEncArgs} -threads {Config.GetInt("ffEncThreads")} -c:a copy {outPath.Wrap()}"; + string args = $" {vsyncStr} -f concat -r {fps.ToString().Replace(",", ".")} -i {vfrFilename} -c:v {enc} -crf {crf} {presetStr} {videoEncArgs} -threads {Config.GetInt("ffEncThreads")} -c:a copy {outPath.Wrap()}"; await AvProcess.RunFfmpeg(args, framesFile.GetParentDir(), AvProcess.LogMode.Hidden); } @@ -124,7 +124,7 @@ namespace Flowframes string loopStr = (looptimes > 0) ? $"-stream_loop {looptimes}" : ""; string vsyncStr = Config.GetInt("vfrMode") == 0 ? "-vsync 1" : "-vsync 2"; string vfrFilename = Path.GetFileName(concatFile); - string args = $" {loopStr} {vsyncStr} -f concat -safe 0 -i {vfrFilename} -r {fps.ToString().Replace(",", ".")} -c copy -pix_fmt yuv420p -movflags +faststart {outPath.Wrap()}"; + string args = $" {loopStr} {vsyncStr} -f concat -r {fps.ToString().Replace(",", ".")} -i {vfrFilename} -c copy -pix_fmt yuv420p -movflags +faststart {outPath.Wrap()}"; await AvProcess.RunFfmpeg(args, concatFile.GetParentDir(), AvProcess.LogMode.Hidden); } diff --git a/Code/Main/Interpolate.cs b/Code/Main/Interpolate.cs index a9b7bc8..0addc32 100644 --- a/Code/Main/Interpolate.cs +++ b/Code/Main/Interpolate.cs @@ -170,8 +170,10 @@ namespace Flowframes public static async Task RunAi(string outpath, int targetFrames, int tilesize, AI ai) { - if(Config.GetInt("autoEncMode") > 0) + if (Config.GetInt("autoEncMode") > 0) currentlyUsingAutoEnc = IOUtils.GetAmountOfFiles(currentFramesPath, false) * lastInterpFactor >= (AutoEncode.chunkSize + AutoEncode.safetyBufferFrames) * 1.1f; + else + currentlyUsingAutoEnc = false; Directory.CreateDirectory(outpath); diff --git a/Code/Main/InterpolateUtils.cs b/Code/Main/InterpolateUtils.cs index 8350b98..f8453fc 100644 --- a/Code/Main/InterpolateUtils.cs +++ b/Code/Main/InterpolateUtils.cs @@ -138,7 +138,7 @@ namespace Flowframes.Main passes = false; } if (!passes) - i.Cancel("Invalid settings detected."); + i.Cancel("Invalid settings detected.", true); return passes; } diff --git a/Code/OS/AiProcess.cs b/Code/OS/AiProcess.cs index 82eb382..debe360 100644 --- a/Code/OS/AiProcess.cs +++ b/Code/OS/AiProcess.cs @@ -159,7 +159,7 @@ namespace Flowframes } Process rifePy = OSUtils.NewProcess(!OSUtils.ShowHiddenCmd()); - AiStarted(rifePy, 3250, "png"); + AiStarted(rifePy, 3500, "png"); rifePy.StartInfo.Arguments = $"{OSUtils.GetCmdArg()} cd /D {PkgUtils.GetPkgFolder(Packages.rifeCuda).Wrap()} & " + $"set CUDA_VISIBLE_DEVICES={Config.Get("torchGpus")} & {Pytorch.GetPyCmd()} {script} {args} --imgformat {InterpolateUtils.lastExt} --output {Paths.interpDir}"; Logger.Log($"Running RIFE ({script})...", false);