mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-24 12:19:27 +01:00
Refresh import frame extensions before extracting
This commit is contained in:
@@ -196,7 +196,9 @@ namespace Flowframes
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshExtensions()
|
||||
public enum FrameType { Import, Interp, Both };
|
||||
|
||||
public void RefreshExtensions(FrameType type = FrameType.Both)
|
||||
{
|
||||
bool pngOutput = outMode == Interpolate.OutMode.ImgPng;
|
||||
bool aviHqChroma = outMode == Interpolate.OutMode.VidAvi && Config.Get(Config.Key.aviColors) != "yuv420p";
|
||||
@@ -206,16 +208,22 @@ namespace Flowframes
|
||||
|
||||
if (alpha || forceHqChroma) // Force PNG if alpha is enabled, or output is not 4:2:0 subsampled
|
||||
{
|
||||
framesExt = ".png";
|
||||
interpExt = ".png";
|
||||
if(type == FrameType.Both || type == FrameType.Import)
|
||||
framesExt = ".png";
|
||||
|
||||
if (type == FrameType.Both || type == FrameType.Interp)
|
||||
interpExt = ".png";
|
||||
}
|
||||
else
|
||||
{
|
||||
framesExt = (Config.GetBool(Config.Key.jpegFrames) ? ".jpg" : ".png");
|
||||
interpExt = (Config.GetBool(Config.Key.jpegInterp) ? ".jpg" : ".png");
|
||||
if (type == FrameType.Both || type == FrameType.Import)
|
||||
framesExt = (Config.GetBool(Config.Key.jpegFrames) ? ".jpg" : ".png");
|
||||
|
||||
if (type == FrameType.Both || type == FrameType.Interp)
|
||||
interpExt = (Config.GetBool(Config.Key.jpegInterp) ? ".jpg" : ".png");
|
||||
}
|
||||
|
||||
Logger.Log($"RefreshExtensions - Using '{framesExt}' for imported frames, using '{interpExt}' for interpolated frames", true);
|
||||
Logger.Log($"RefreshExtensions({type}) - Using '{framesExt}' for imported frames, using '{interpExt}' for interpolated frames", true);
|
||||
}
|
||||
|
||||
public string Serialize ()
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace Flowframes
|
||||
{
|
||||
if (canceled) return;
|
||||
Program.mainForm.SetStatus("Extracting frames from video...");
|
||||
current.RefreshExtensions(InterpSettings.FrameType.Import);
|
||||
bool mpdecimate = Config.GetInt(Config.Key.dedupMode) == 2;
|
||||
Size res = await Utils.GetOutputResolution(inPath, true, true);
|
||||
await FfmpegExtract.VideoToFrames(inPath, outPath, alpha, current.inFpsDetected, mpdecimate, false, res, current.framesExt);
|
||||
|
||||
Reference in New Issue
Block a user