mirror of
https://github.com/n00mkrad/flowframes.git
synced 2026-09-02 04:00:59 +02:00
Update FfmpegEncode.cs
This commit is contained in:
@@ -90,12 +90,12 @@ namespace Flowframes.Media
|
||||
if (logMode != LogMode.Hidden)
|
||||
Logger.Log((resampleFps <= 0) ? $"Encoding GIF..." : $"Encoding GIF resampled to {resampleFps.ToString().Replace(",", ".")} FPS...");
|
||||
|
||||
string vfrFilename = Path.GetFileName(framesFile);
|
||||
string framesFilename = Path.GetFileName(framesFile);
|
||||
string dither = Config.Get("gifDitherType").Split(' ').First();
|
||||
string paletteFilter = palette ? $"-vf \"split[s0][s1];[s0]palettegen={colors}[p];[s1][p]paletteuse=dither={dither}\"" : "";
|
||||
string fpsFilter = (resampleFps <= 0) ? "" : $"fps=fps={resampleFps.ToStringDot()}";
|
||||
string vf = FormatUtils.ConcatStrings(new string[] { paletteFilter, fpsFilter });
|
||||
string args = $"-f concat -r {rate} -i {vfrFilename.Wrap()} -gifflags -offsetting {vf} {outPath.Wrap()}";
|
||||
string args = $"-f concat -r {rate} -i {framesFilename.Wrap()} -gifflags -offsetting {vf} {outPath.Wrap()}";
|
||||
await RunFfmpeg(args, framesFile.GetParentDir(), LogMode.OnlyLastLine, "error", TaskType.Encode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user