1
mirror of https://github.com/n00mkrad/flowframes synced 2024-11-16 19:10:31 +01:00

minor logging improvements

This commit is contained in:
N00MKRAD 2020-12-21 15:03:31 +01:00
parent 38e4156bb8
commit 3e190bb05c
3 changed files with 5 additions and 3 deletions

View File

@ -46,6 +46,7 @@ namespace Flowframes
string args = $"-i {inputFile.Wrap()} {pngComprArg} -vsync 0 -pix_fmt rgb24 {timecodeStr} {vf} {sizeStr} \"{frameFolderPath}/%{pad}d.png\"";
AvProcess.LogMode logMode = Interpolate.currentInputFrameCount > 50 ? AvProcess.LogMode.OnlyLastLine : AvProcess.LogMode.Hidden;
await AvProcess.RunFfmpeg(args, logMode);
if (!sceneDetect) Logger.Log($"Extracted {IOUtils.GetAmountOfFiles(frameFolderPath, false, "*.png")} frames from input.", false, true);
await Task.Delay(1);
if (delSrc)
DeleteSource(inputFile);

View File

@ -285,7 +285,7 @@ namespace Flowframes.Main
Logger.Log("Message: " + msg, true);
}
public static Size GetOutputResolution (string inputPath)
public static Size GetOutputResolution (string inputPath, bool print = true)
{
Size resolution = IOUtils.GetVideoRes(inputPath);
int maxHeight = RoundDiv2(Config.GetInt("maxVidHeight"));
@ -294,7 +294,8 @@ namespace Flowframes.Main
float factor = (float)maxHeight / resolution.Height;
Logger.Log($"Un-rounded downscaled size: {(resolution.Width * factor).ToString("0.00")}x{Config.GetInt("maxVidHeight")}", true);
int width = RoundDiv2((resolution.Width * factor).RoundToInt());
Logger.Log($"Video is bigger than the maximum - Downscaling to {width}x{maxHeight}.");
if(print)
Logger.Log($"Video is bigger than the maximum - Downscaling to {width}x{maxHeight}.");
return new Size(width, maxHeight);
}
else

View File

@ -150,7 +150,7 @@ namespace Flowframes
{
string rifeDir = Path.Combine(Paths.GetPkgPath(), Path.GetFileNameWithoutExtension(Packages.rifeCuda.fileName));
string script = "inference_video.py";
bool uhd = InterpolateUtils.GetOutputResolution(Interpolate.current.inPath).Height >= Config.GetInt("uhdThresh");
bool uhd = InterpolateUtils.GetOutputResolution(Interpolate.current.inPath, false).Height >= Config.GetInt("uhdThresh");
string uhdStr = uhd ? "--UHD" : "";
string args = $" --img {framesPath.Wrap()} --exp {(int)Math.Log(interpFactor, 2)} {uhdStr} --imgformat {InterpolateUtils.GetOutExt()} --output {Paths.interpDir}";