Check NVENC compatibility before even starting interpolation

This commit is contained in:
N00MKRAD
2021-02-21 21:18:31 +01:00
parent 5f3ffc8c4a
commit 5949e570a7
5 changed files with 35 additions and 11 deletions

View File

@@ -77,7 +77,7 @@ namespace Flowframes
if (line.Contains("Could not open file"))
Interpolate.Cancel($"FFmpeg Error: {line}");
if (line.Contains("No NVENC capable devices found"))
if (line.Contains("No NVENC capable devices found") || line.Contains("Cannot load nvcuda.dll"))
Interpolate.Cancel($"FFmpeg Error: {line}\nMake sure you have an NVENC-capable Nvidia GPU.");
if (!hidden && showProgressBar && line.Contains("time="))

View File

@@ -169,6 +169,14 @@ namespace Flowframes
}
}
public static async Task<bool> IsEncoderCompatible(string enc)
{
Logger.Log($"IsEncoderCompatible('{enc}')", true, false, "ffmpeg");
string args = $"-loglevel error -f lavfi -i color=black:s=540x540 -vframes 1 -an -c:v {enc} -f null -";
string output = await GetFfmpegOutputAsync(args);
return !output.ToLower().Contains("error");
}
public static string GetAudioCodec(string path)
{
string args = $" -v panic -show_streams -select_streams a -show_entries stream=codec_name {path.Wrap()}";