From 88867d402ce89e1fdaf9666047d5f9e51b26459e Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Mon, 30 Jan 2023 01:55:22 +0100 Subject: [PATCH] vapoursynth: Default to 25fps when no clip fps set This matches the behavior of the FFMS video provider. --- src/video_provider_vs.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/video_provider_vs.cpp b/src/video_provider_vs.cpp index 8ecd621bb..bde0f9a70 100644 --- a/src/video_provider_vs.cpp +++ b/src/video_provider_vs.cpp @@ -141,7 +141,13 @@ VapoursynthVideoProvider::VapoursynthVideoProvider(agi::fs::path const& filename // Assume constant frame rate, since handling VFR would require going through all frames when loading. // Users can load custom timecodes files to deal with VFR. // Alternatively (TODO) the provider could read timecodes and keyframes from a second output node. - fps = agi::vfr::Framerate(vi->fpsNum, vi->fpsDen); + int fpsNum = vi->fpsNum; + int fpsDen = vi->fpsDen; + if (fpsDen == 0) { + fpsNum = 25; + fpsDen = 1; + } + fps = agi::vfr::Framerate(fpsNum, fpsDen); // Find the first frame to get some info const VSFrame *frame;