Don't allow >240 FPS when using SVT-AV1 (as this is the highest supported rate)

This commit is contained in:
n00mkrad
2022-07-19 21:54:25 +02:00
parent 7c07e9d5ac
commit 30b3faf16d
3 changed files with 13 additions and 7 deletions

View File

@@ -40,7 +40,7 @@ namespace Flowframes
if (!Utils.CheckAiAvailable(current.ai, current.model)) return; // Check if selected AI pkg is installed
if (!AutoEncodeResume.resumeNextRun && !Utils.CheckDeleteOldTempFolder()) return; // Try to delete temp folder if an old one exists
if (!Utils.CheckPathValid(current.inPath)) return; // Check if input path/file is valid
if (!(await Utils.CheckEncoderValid())) return; // Check NVENC compat
if (!(await Utils.CheckEncoderValid(current.outFps.GetFloat()))) return; // Check encoder compat
Utils.ShowWarnings(current.interpFactor, current.ai);
currentInputFrameCount = await GetFrameCountCached.GetFrameCountAsync(current.inPath);
current.stepByStep = false;

View File

@@ -97,7 +97,7 @@ namespace Flowframes.Main
currentInputFrameCount = await GetFrameCountCached.GetFrameCountAsync(current.inPath);
if (Config.GetBool(Config.Key.sbsAllowAutoEnc) && !(await InterpolateUtils.CheckEncoderValid())) return;
if (Config.GetBool(Config.Key.sbsAllowAutoEnc) && !(await InterpolateUtils.CheckEncoderValid(current.outFps.GetFloat()))) return;
if (canceled) return;
Program.mainForm.SetStatus("Running AI...");
@@ -123,7 +123,7 @@ namespace Flowframes.Main
}
}
if (!(await InterpolateUtils.CheckEncoderValid())) return;
if (!(await InterpolateUtils.CheckEncoderValid(current.outFps.GetFloat()))) return;
string[] outFrames = IoUtils.GetFilesSorted(current.interpFolder, current.interpExt);

View File

@@ -222,14 +222,20 @@ namespace Flowframes.Main
return true;
}
public static async Task<bool> CheckEncoderValid ()
public static async Task<bool> CheckEncoderValid (float encodeFps)
{
string enc = FfmpegUtils.GetEnc(FfmpegUtils.GetCodec(I.current.outMode));
if (!enc.ToLower().Contains("nvenc"))
return true;
float maxAv1Fps = 240;
if (!(await FfmpegCommands.IsEncoderCompatible(enc)))
if (enc.ToLower().Contains("av1") && encodeFps > maxAv1Fps)
{
UiUtils.ShowMessageBox($"The selected encoder only supports up to {maxAv1Fps} FPS!\nPlease use a different encoder or reduce the interpolation factor.", UiUtils.MessageType.Error);
I.Cancel();
return false;
}
if (enc.ToLower().Contains("nvenc") && !(await FfmpegCommands.IsEncoderCompatible(enc)))
{
UiUtils.ShowMessageBox("NVENC encoding is not available on your hardware!\nPlease use a different encoder.", UiUtils.MessageType.Error);
I.Cancel();