Prefer FFmpeg FPS readout over FFprobe for GIF, APNG, AWEBP

This commit is contained in:
N00MKRAD
2021-05-24 13:43:48 +02:00
parent fd9f5235b1
commit fc3b6eb4b5
3 changed files with 36 additions and 22 deletions

View File

@@ -309,11 +309,14 @@ namespace Flowframes.IO
public static async Task<Fraction> GetVideoFramerate (string path)
{
string[] preferFfmpegReadoutFormats = new string[] { ".gif", ".png", ".apng", ".webp" };
bool preferFfmpegReadout = preferFfmpegReadoutFormats.Contains(Path.GetExtension(path).ToLower());
Fraction fps = new Fraction();
try
{
fps = await FfmpegCommands.GetFramerate(path);
fps = await FfmpegCommands.GetFramerate(path, preferFfmpegReadout);
Logger.Log("Detected FPS of " + Path.GetFileName(path) + " as " + fps + " FPS", true);
}
catch