diff --git a/Code/AudioVideo/FFmpegCommands.cs b/Code/AudioVideo/FFmpegCommands.cs index 7484c54..f01cd3e 100644 --- a/Code/AudioVideo/FFmpegCommands.cs +++ b/Code/AudioVideo/FFmpegCommands.cs @@ -127,22 +127,13 @@ namespace Flowframes DeleteSource(inputPath); } - public static async void FramesToGif(string inputDir, bool palette, int fps, string prefix, bool delSrc = false) - { - int nums = IOUtils.GetFilenameCounterLength(IOUtils.GetFilesSorted(inputDir, false, "*.png")[0], prefix); - string filter = palette ? "-vf \"split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse\"" : ""; - string args = "-framerate " + fps + " -i \"" + inputDir + "\\" + prefix + "%0" + nums + "d.png\" -f gif " + filter + " \"" + inputDir + ".gif\""; - await AvProcess.RunFfmpeg(args, AvProcess.LogMode.OnlyLastLine); - if (delSrc) - DeleteSource(inputDir); - } - - public static async Task FramesToGifVfr(string framesFile, string outPath, bool palette, int colors = 64) + public static async Task FramesToGifConcat(string framesFile, string outPath, float fps, bool palette, int colors = 64) { Logger.Log($"Encoding GIF..."); string vfrFilename = Path.GetFileName(framesFile); string filter = palette ? $"-vf \"split[s0][s1];[s0]palettegen={colors}[p];[s1][p]paletteuse=dither=floyd_steinberg:diff_mode=rectangle\"" : ""; - string args = $"-f concat -i {vfrFilename.Wrap()} -f gif {filter} {outPath.Wrap()}"; + string rate = fps.ToString().Replace(",", "."); + string args = $"-loglevel error -f concat -r {rate} -i {vfrFilename.Wrap()} -f gif {filter} {outPath.Wrap()}"; await AvProcess.RunFfmpeg(args, framesFile.GetParentDir(), AvProcess.LogMode.OnlyLastLine); } diff --git a/Code/Main/CreateVideo.cs b/Code/Main/CreateVideo.cs index d87f131..032d6b6 100644 --- a/Code/Main/CreateVideo.cs +++ b/Code/Main/CreateVideo.cs @@ -102,7 +102,7 @@ namespace Flowframes.Main if (mode == i.OutMode.VidGif) { - await FFmpegCommands.FramesToGifVfr(vfrFile, outPath, true, Config.GetInt("gifColors")); + await FFmpegCommands.FramesToGifConcat(vfrFile, outPath, fps, true, Config.GetInt("gifColors")); } else { diff --git a/Code/OS/AiProcess.cs b/Code/OS/AiProcess.cs index 683c963..09bc2ab 100644 --- a/Code/OS/AiProcess.cs +++ b/Code/OS/AiProcess.cs @@ -234,7 +234,7 @@ namespace Flowframes Process rifeNcnn = OSUtils.NewProcess(!OSUtils.ShowHiddenCmd()); AiStarted(rifeNcnn, 1500, 2, inPath); rifeNcnn.StartInfo.Arguments = $"{OSUtils.GetCmdArg()} cd /D {PkgUtils.GetPkgFolder(Packages.rifeNcnn).Wrap()} & rife-ncnn-vulkan.exe " + - $" -v -i {inPath.Wrap()} -o {outPath.Wrap()} -g {Config.Get("ncnnGpus")} -f {InterpolateUtils.GetOutExt()} -j {GetNcnnThreads()}"; + $" -v -i {inPath.Wrap()} -o {outPath.Wrap()} -m rife1.7 -g {Config.Get("ncnnGpus")} -f {InterpolateUtils.GetOutExt()} -j {GetNcnnThreads()}"; Logger.Log("cmd.exe " + rifeNcnn.StartInfo.Arguments, true); if (!OSUtils.ShowHiddenCmd()) { diff --git a/Pkgs/rife-ncnn/contextnet.bin b/Pkgs/rife-ncnn/contextnet.bin deleted file mode 100644 index 7f37f33..0000000 Binary files a/Pkgs/rife-ncnn/contextnet.bin and /dev/null differ diff --git a/Pkgs/rife-ncnn/rife-ncnn-vulkan.exe b/Pkgs/rife-ncnn/rife-ncnn-vulkan.exe index 3e3279e..d319551 100644 Binary files a/Pkgs/rife-ncnn/rife-ncnn-vulkan.exe and b/Pkgs/rife-ncnn/rife-ncnn-vulkan.exe differ diff --git a/Pkgs/rife-ncnn/ver.ini b/Pkgs/rife-ncnn/ver.ini deleted file mode 100644 index 31ee136..0000000 --- a/Pkgs/rife-ncnn/ver.ini +++ /dev/null @@ -1,2 +0,0 @@ -2 # hd model, no tiling -1 # initial \ No newline at end of file diff --git a/pkgs/rife-ncnn/rife1.7/contextnet.bin b/pkgs/rife-ncnn/rife1.7/contextnet.bin new file mode 100644 index 0000000..e6bd19e Binary files /dev/null and b/pkgs/rife-ncnn/rife1.7/contextnet.bin differ diff --git a/Pkgs/rife-ncnn/contextnet.param b/pkgs/rife-ncnn/rife1.7/contextnet.param similarity index 100% rename from Pkgs/rife-ncnn/contextnet.param rename to pkgs/rife-ncnn/rife1.7/contextnet.param diff --git a/Pkgs/rife-ncnn/flownet.bin b/pkgs/rife-ncnn/rife1.7/flownet.bin similarity index 72% rename from Pkgs/rife-ncnn/flownet.bin rename to pkgs/rife-ncnn/rife1.7/flownet.bin index d08533a..581d5e2 100644 Binary files a/Pkgs/rife-ncnn/flownet.bin and b/pkgs/rife-ncnn/rife1.7/flownet.bin differ diff --git a/Pkgs/rife-ncnn/flownet.param b/pkgs/rife-ncnn/rife1.7/flownet.param similarity index 100% rename from Pkgs/rife-ncnn/flownet.param rename to pkgs/rife-ncnn/rife1.7/flownet.param diff --git a/Pkgs/rife-ncnn/fusionnet.bin b/pkgs/rife-ncnn/rife1.7/fusionnet.bin similarity index 73% rename from Pkgs/rife-ncnn/fusionnet.bin rename to pkgs/rife-ncnn/rife1.7/fusionnet.bin index bcc7a2d..b3fbe42 100644 Binary files a/Pkgs/rife-ncnn/fusionnet.bin and b/pkgs/rife-ncnn/rife1.7/fusionnet.bin differ diff --git a/Pkgs/rife-ncnn/fusionnet.param b/pkgs/rife-ncnn/rife1.7/fusionnet.param similarity index 100% rename from Pkgs/rife-ncnn/fusionnet.param rename to pkgs/rife-ncnn/rife1.7/fusionnet.param diff --git a/pkgs/rife-ncnn/vcomp140.dll b/pkgs/rife-ncnn/vcomp140.dll new file mode 100644 index 0000000..70f7363 Binary files /dev/null and b/pkgs/rife-ncnn/vcomp140.dll differ