Fixed being unable to interpolate image sequences with NCNN VS if dedupe is enabled

This commit is contained in:
n00mkrad
2025-07-24 18:34:57 +02:00
parent c1042cbdf1
commit 9c0bad36c3
4 changed files with 8 additions and 5 deletions

View File

@@ -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 " : "";

View File

@@ -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);

View File

@@ -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);

View File

@@ -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))