mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 16:37:48 +01:00
Fixed being unable to interpolate image sequences with NCNN VS if dedupe is enabled
This commit is contained in:
@@ -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} " : "";
|
string rateStr = rate >= 0 ? $"-r {rate} " : "";
|
||||||
return filePath.IsConcatFile() ? $"{rateStr}-safe 0 -f concat " : "";
|
return filePath.IsConcatFile() ? $"{rateStr}-safe 0 -f concat " : "";
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ namespace Flowframes.Magick
|
|||||||
Process ffmpeg = OsUtils.NewProcess(true);
|
Process ffmpeg = OsUtils.NewProcess(true);
|
||||||
string baseCmd = $"/C cd /D {Path.Combine(IO.Paths.GetPkgPath(), IO.Paths.audioVideoDir).Wrap()}";
|
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);
|
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();
|
var ffmpegOutputLines = (await Task.Run(() => OsUtils.GetProcStdOut(ffmpeg, true))).SplitIntoLines();
|
||||||
ffmpegOutputLines = ffmpegOutputLines.Where(l => l.Contains("keep_count")).Select(l => l.Split(']').Last()).ToArray();
|
ffmpegOutputLines = ffmpegOutputLines.Where(l => l.Contains("keep_count")).Select(l => l.Split(']').Last()).ToArray();
|
||||||
var test = string.Join("\n", ffmpegOutputLines);
|
var test = string.Join("\n", ffmpegOutputLines);
|
||||||
|
|||||||
@@ -33,8 +33,9 @@ namespace Flowframes.Main
|
|||||||
file.Delete();
|
file.Delete();
|
||||||
|
|
||||||
benchmark.Restart();
|
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);
|
CreateFramesFileVid(Interpolate.currentSettings.inPath, Interpolate.currentSettings.tempFolder, loopEnabled, interpFactor);
|
||||||
else
|
else
|
||||||
await CreateFramesFileImgSeq(tempFolder, loopEnabled, interpFactor);
|
await CreateFramesFileImgSeq(tempFolder, loopEnabled, interpFactor);
|
||||||
|
|||||||
@@ -211,9 +211,11 @@ namespace Flowframes
|
|||||||
{
|
{
|
||||||
await Task.Run(async () => { await FrameRename.Rename(); });
|
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))
|
if (!ai.Piped || (ai.Piped && currentSettings.dedupe))
|
||||||
|
|||||||
Reference in New Issue
Block a user