mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 08:27:44 +01:00
Disable CFR frame extraction for GIF inputs
This commit is contained in:
@@ -106,7 +106,8 @@ namespace Flowframes.Media
|
|||||||
string mpStr = deDupe ? GetMpdecimate(true) : "";
|
string mpStr = deDupe ? GetMpdecimate(true) : "";
|
||||||
string filters = FormatUtils.ConcatStrings(new[] { GetPadFilter(), mpStr });
|
string filters = FormatUtils.ConcatStrings(new[] { GetPadFilter(), mpStr });
|
||||||
string vf = filters.Length > 2 ? $"-vf {filters}" : "";
|
string vf = filters.Length > 2 ? $"-vf {filters}" : "";
|
||||||
string rateArg = (rate.GetFloat() > 0 && !deDupe) ? $" -fps_mode cfr -r {rate}" : "-fps_mode passthrough";
|
bool allowCfr = rate.GetFloat() > 0 && !deDupe && Path.GetExtension(inputFile).Lower() != ".gif"; // Forcing CFR on GIFs causes issues // TODO: Maybe never use CFR???
|
||||||
|
string rateArg = allowCfr ? $" -fps_mode cfr -r {rate}" : "-fps_mode passthrough";
|
||||||
string args = $"{GetTrimArg(true)} -itsscale {Interpolate.currentMediaFile.VideoStreams.First().FpsInfo.VfrRatio} -i {inputFile.Wrap()} {GetImgArgs(format, true, alpha)} {rateArg} -frame_pts 1 {vf} {sizeStr} {GetTrimArg(false)} \"{framesDir}/%{Padding.inputFrames}d{format}\""; LogMode logMode = Interpolate.currentMediaFile.FrameCount > 50 ? LogMode.OnlyLastLine : LogMode.Hidden;
|
string args = $"{GetTrimArg(true)} -itsscale {Interpolate.currentMediaFile.VideoStreams.First().FpsInfo.VfrRatio} -i {inputFile.Wrap()} {GetImgArgs(format, true, alpha)} {rateArg} -frame_pts 1 {vf} {sizeStr} {GetTrimArg(false)} \"{framesDir}/%{Padding.inputFrames}d{format}\""; LogMode logMode = Interpolate.currentMediaFile.FrameCount > 50 ? LogMode.OnlyLastLine : LogMode.Hidden;
|
||||||
await RunFfmpeg(args, logMode, true);
|
await RunFfmpeg(args, logMode, true);
|
||||||
int amount = IoUtils.GetAmountOfFiles(framesDir, false, "*" + format);
|
int amount = IoUtils.GetAmountOfFiles(framesDir, false, "*" + format);
|
||||||
|
|||||||
Reference in New Issue
Block a user