diff --git a/CodeLegacy/Extensions/ExtensionMethods.cs b/CodeLegacy/Extensions/ExtensionMethods.cs index 7e8b75c..116cc19 100644 --- a/CodeLegacy/Extensions/ExtensionMethods.cs +++ b/CodeLegacy/Extensions/ExtensionMethods.cs @@ -279,7 +279,7 @@ namespace Flowframes } } - public static string GetConcStr(this string filePath, int rate = -1) + public static string GetConcStr(this string filePath, float rate = -1) { string rateStr = rate >= 0 ? $"-r {rate} " : ""; return filePath.IsConcatFile() ? $"{rateStr}-safe 0 -f concat " : ""; diff --git a/CodeLegacy/Magick/Dedupe.cs b/CodeLegacy/Magick/Dedupe.cs index d11e612..28e9c69 100644 --- a/CodeLegacy/Magick/Dedupe.cs +++ b/CodeLegacy/Magick/Dedupe.cs @@ -269,7 +269,7 @@ namespace Flowframes.Magick Process ffmpeg = OsUtils.NewProcess(true); string baseCmd = $"/C cd /D {Path.Combine(IO.Paths.GetPkgPath(), IO.Paths.audioVideoDir).Wrap()}"; string mpDec = FfmpegCommands.GetMpdecimate(wrap: false); // FfmpegCommands.GetMpdecimate((int)FfmpegCommands.MpDecSensitivity.Normal, false); - ffmpeg.StartInfo.Arguments = $"{baseCmd} & ffmpeg -loglevel debug -y {videoPath.GetConcStr()} -i {videoPath.Wrap()} -fps_mode vfr -vf {mpDec} -f null NUL 2>&1 | findstr keep_count:"; + ffmpeg.StartInfo.Arguments = $"{baseCmd} & ffmpeg -loglevel debug -y {videoPath.GetConcStr(Interpolate.currentSettings.inFps.Float)} -i {videoPath.Wrap()} -fps_mode vfr -vf {mpDec} -f null NUL 2>&1 | findstr keep_count:"; var ffmpegOutputLines = (await Task.Run(() => OsUtils.GetProcStdOut(ffmpeg, true))).SplitIntoLines(); ffmpegOutputLines = ffmpegOutputLines.Where(l => l.Contains("keep_count")).Select(l => l.Split(']').Last()).ToArray(); var test = string.Join("\n", ffmpegOutputLines); diff --git a/CodeLegacy/Main/FrameOrder.cs b/CodeLegacy/Main/FrameOrder.cs index 1d0f481..6bb2f18 100644 --- a/CodeLegacy/Main/FrameOrder.cs +++ b/CodeLegacy/Main/FrameOrder.cs @@ -33,8 +33,9 @@ namespace Flowframes.Main file.Delete(); benchmark.Restart(); + bool vs = Interpolate.currentSettings.ai.NameInternal == Implementations.rifeNcnnVs.NameInternal; - if (Interpolate.currentSettings.ai.NameInternal == Implementations.rifeNcnnVs.NameInternal) + if (vs) // && !Interpolate.currentSettings.inputIsFrames) CreateFramesFileVid(Interpolate.currentSettings.inPath, Interpolate.currentSettings.tempFolder, loopEnabled, interpFactor); else await CreateFramesFileImgSeq(tempFolder, loopEnabled, interpFactor); diff --git a/CodeLegacy/Main/Interpolate.cs b/CodeLegacy/Main/Interpolate.cs index 72ad451..6ba4f2e 100644 --- a/CodeLegacy/Main/Interpolate.cs +++ b/CodeLegacy/Main/Interpolate.cs @@ -211,9 +211,11 @@ namespace Flowframes { await Task.Run(async () => { await FrameRename.Rename(); }); } - else if (ai.Piped && currentSettings.dedupe) + + if (ai.Piped && currentSettings.dedupe) { - await Task.Run(async () => { await Dedupe.CreateFramesFileVideo(currentSettings.inPath, Config.GetBool(Config.Key.enableLoop)); }); + string path = currentMediaFile.IsDirectory ? currentMediaFile.ImportPath : currentSettings.inPath; + await Task.Run(async () => { await Dedupe.CreateFramesFileVideo(path, Config.GetBool(Config.Key.enableLoop)); }); } if (!ai.Piped || (ai.Piped && currentSettings.dedupe))