HolyWu / vs-rife

RIFE function for VapourSynth
MIT License
103 stars 8 forks source link

Small feature request for RIFEv4: target fps as alternative to multiplier #17

Closed Selur closed 2 years ago

Selur commented 2 years ago

I would it be possible to allow setting a target fps instead of a multiplier when using RIFEv4? When going from for example 23.976 (24000/1001) to 60 fps, having to use (60 * 1001 / 24000 =) 2,5025 is kind of annoying. ;) I know could write a wrapper arount the rife.RIFE but I suspect depending on the resulting float it would be more accurate if this was done inside the filter.

Selur commented 2 years ago

Starting with 24000/1001 fps content and looking at:

Frame: 71928 (= 24000/1001fps 5060sec) with a multiplier of 2, I get frame 143856 (= 224000/1001fps 50*60sec), which is the same. -> everything seems alright.

Frame: 71928 (= 24000/1001fps 5060sec) with a multiplier of 2.5025, I get frame 180000 (= 2.5025 24000/1001fps fps 50*60sec), which is the same. -> everything seems alright.

Frame 143856 (= 24000/1001fps 10060sec) with a multiplier of 2.5025 I get frame 360000 (= 2.5025 24000/1001fps fps 100*60sec), which is not the same. Looking through the frames 359640 seems to be the correct one which corresponds to a multiplier of 2.5.

=> My guess is that that either multiplier can only have one (or two?) decimal or there is a bug.

Selur commented 2 years ago

For those having the same issue: As a workaround, rounding up to 2 decimals (so 2.5025 becomes 2.51) using that multiplier and then using ChangeFPS to the real target fps seems to work fine.

Selur commented 2 years ago

Sorry, wanted to post this over at https://github.com/HomeOfVapourSynthEvolution/VapourSynth-RIFE-ncnn-Vulkan (too many rife impelmentations ;))