From 05b7d7fe1f2d78c58c820c4a6680e3fd92b01c34 Mon Sep 17 00:00:00 2001 From: f0e <7321764+f0e@users.noreply.github.com> Date: Fri, 6 Oct 2023 19:47:19 +1000 Subject: [PATCH] fix manual svp --- src/blur.py | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/blur.py b/src/blur.py index 0b2d602..c04c2fb 100644 --- a/src/blur.py +++ b/src/blur.py @@ -71,24 +71,25 @@ case _: if settings["manual_svp"]: - pass # TODO - # todo - # super = core.svp1.Super(video, settings["super_string"]) - # vectors = core.svp1.Analyse(super['clip'], super['data'], video, settings["vectors_string"]) - - # # insert interpolated fps - # fixed_smooth_string = settings["smooth_string"] - # if "rate:" not in fixed_smooth_string: - # fixed_smooth_string.erase(0, 1); - # fixed_smooth_string.pop_back(); - # fixed_smooth_string = "'{rate:{num:%d,abs:true}," + fixed_smooth_string + "}' % interpolated_fps"; - # } - # else { - # # you're handling it i guess - # fixed_smooth_string = "'" + fixed_smooth_string + "'"; - # } - - # video_script << fmt::format("video = core.svp2.SmoothFps(video, super['clip'], super['data'], vectors['clip'], vectors['data'], {})", fixed_smooth_string) << "\n"; + super = core.svp1.Super(video, settings["super_string"]) + vectors = core.svp1.Analyse( + super["clip"], super["data"], video, settings["vectors_string"] + ) + + # insert interpolated fps + smooth_json = json.loads(settings["smooth_string"]) + if "rate" not in smooth_json: + smooth_json["rate"] = {"num": interpolated_fps, "abs": True} + smooth_str = json.dumps(smooth_json) + + video = core.svp2.SmoothFps( + video, + super["clip"], + super["data"], + vectors["clip"], + vectors["data"], + smooth_str, + ) else: video = interpolate.interpolate_svp( video,