public static async Task <float> GetVideoFramerate(string path) { float fps = 0; try { fps = await FfmpegCommands.GetFramerate(path); Logger.Log("Detected FPS of " + Path.GetFileName(path) + " as " + fps + " FPS", true); } catch { Logger.Log("Failed to read FPS - Please enter it manually."); } return(fps); }
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, preferFfmpegReadout); Logger.Log("Detected FPS of " + Path.GetFileName(path) + " as " + fps + " FPS", true); } catch { Logger.Log("Failed to read FPS - Please enter it manually."); } return(fps); }