Skip to content

Commit 0c25bf6

Browse files
committed
Use correct fixed frame rate for metrics
1 parent 653e0d5 commit 0c25bf6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ff-utils-winforms/IO/IoUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public static async Task<Fraction> GetVideoFramerate (string path)
351351
}
352352
catch
353353
{
354-
Logger.Log("Failed to read FPS - Please enter it manually.");
354+
Logger.Log("Failed to read FPS.");
355355
}
356356

357357
return fps;

ff-utils-winforms/UI/Tasks/UtilGetMetrics.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ public static async Task Run(bool fixRate = true)
4242
form.ShowDialog();
4343
Program.mainForm.SetMetricsVarsFromForm(form);
4444

45-
Logger.Log($"Getting metrics for {Path.GetFileName(vidLq)} compared against {Path.GetFileName(vidHq)}.");
45+
Logger.Log($"Getting metrics for {Path.GetFileName(vidLq)} compared against {Path.GetFileName(vidHq)}...");
4646

47-
string r = fixRate ? "-r 24" : "";
47+
Fraction fps = await IoUtils.GetVideoFramerate(vidLq);
48+
string r = fixRate ? $"-r {(fps.GetFloat() > 0f ? fps.ToString() : "24")}" : "";
4849
string f = await GetAlignFilters();
4950
FfmpegOutputHandler.overrideTargetDurationMs = await FfmpegCommands.GetDurationMs(vidLq);
5051

0 commit comments

Comments
 (0)