mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-25 12:49:26 +01:00
Fix WEBP conversion
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user