Switched to fractional framerates, fixed VFR inputs

This commit is contained in:
N00MKRAD
2021-04-02 14:36:08 +02:00
parent 60ee6c2102
commit b3ab84646b
17 changed files with 379 additions and 75 deletions

View File

@@ -11,6 +11,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Flowframes.Data;
namespace Flowframes.UI
{
@@ -38,14 +39,14 @@ namespace Flowframes.UI
Program.mainForm.currInDurationCut = Program.mainForm.currInDuration;
int frameCount = await InterpolateUtils.GetInputFrameCountAsync(path);
string fpsStr = "Not Found";
float fps = await IOUtils.GetFpsFolderOrVideo(path);
fpsInTbox.Text = fps.ToString();
Fraction fps = (await IOUtils.GetFpsFolderOrVideo(path));
fpsInTbox.Text = fps.GetString();
if (fps > 0)
fpsStr = fps.ToString();
if (fps.GetFloat() > 0)
fpsStr = $"{fps} (~{fps.GetFloat()})";
Logger.Log($"Video FPS: {fpsStr} - Total Number Of Frames: {frameCount}", false, true);
Program.mainForm.GetInputFpsTextbox().ReadOnly = (fps > 0 && !Config.GetBool("allowCustomInputRate", false));
Program.mainForm.GetInputFpsTextbox().ReadOnly = (fps.GetFloat() > 0 && !Config.GetBool("allowCustomInputRate", false));
Program.mainForm.currInFps = fps;
Program.mainForm.currInFrames = frameCount;
Program.mainForm.UpdateInputInfo();