Fix WEBP conversion

This commit is contained in:
n00mkrad
2021-08-30 22:15:55 +02:00
parent ebf3e79411
commit 3fd9bbd72b
2 changed files with 2 additions and 3 deletions

View File

@@ -10,7 +10,6 @@ using I = Flowframes.Interpolate;
using System.Diagnostics;
using Flowframes.Data;
using Flowframes.Media;
using Microsoft.VisualBasic.Logging;
using Flowframes.MiscUtils;
using Flowframes.Os;
@@ -43,7 +42,7 @@ namespace Flowframes.Main
return;
}
if (IoUtils.GetAmountOfFiles(path, false, "*" + I.current.interpExt) <= 1)
if (IoUtils.GetAmountOfFiles(path, false, "*.*" + I.current.interpExt) <= 1)
{
I.Cancel("Output folder does not contain frames - An error must have occured during interpolation!", AiProcess.hasShownError);
return;
@@ -82,7 +81,6 @@ namespace Flowframes.Main
bool fpsLimit = maxFps.GetFloat() > 0f && I.current.outFps.GetFloat() > maxFps.GetFloat();
bool dontEncodeFullFpsVid = fpsLimit && Config.GetInt(Config.Key.maxFpsMode) == 0;
string framesFile = Path.Combine(framesPath.GetParentDir(), Paths.GetFrameOrderFilename(I.current.interpFactor));
if (!dontEncodeFullFpsVid)
{

View File

@@ -80,6 +80,7 @@ namespace Flowframes.Media
string rate = fps.ToString().Replace(",", ".");
string vf = (resampleFps.GetFloat() < 0.1f) ? "" : $"-vf fps=fps={resampleFps}";
string compression = format == "png" ? pngCompr : "-q:v 1";
string codec = format.ToLower() == "webp" ? "-c:v libwebp" : ""; // Specify libwebp to avoid putting all frames into single AWEBP
string args = $"-vsync 0 -r {rate} {inArg} {compression} {vf} \"{outDir}/%{Padding.interpFrames}d.{format}\"";
await RunFfmpeg(args, framesFile.GetParentDir(), logMode, "error", TaskType.Encode, true);
IoUtils.TryDeleteIfExists(linksDir);