Log in

View Full Version : Interpolate duplicate frames in half frame rate scenes


LigH
29th December 2024, 14:26
I got a video which contains a half frame rate content (by duplicated frames) in some dim scenes but full frame rate where the brightness was suitable for the camera. Do you know a method of replacing the duplicate frames with motion estimating interpolation results like those provided by MVTools2?

Selur
29th December 2024, 15:16
sound like you are looking for FillDrops (https://github.com/JJKylee/Filter-Scripts/blob/main/AviSynth/FillDrops.avsi), there's also a Vapourynth version with some extras (https://github.com/Selur/VapoursynthScriptsInHybrid/blob/master/filldrops.py).

Cu Selur

LigH
29th December 2024, 15:28
Imagine young Magneto meeting the real Raven...

:thanks:

RetsimLegin
3rd January 2025, 11:05
Here is what I'd try. It all uses free gui apps (not scripts).

1: Split the video into segments where there are segments that are "right" and segmnets that are "wrong". avidemux will do that.
2: For each of the "wrong" segments retime the fps to half what it was. avidemux will do that. Video will play at double speed.
3: For each of those retimed segments use the AI frame doubler that is part of https://www.winxdvd.com/giveaway/convert-video-free.htm
4: Edit the original "right" parts and the doubled "wrong" parts back together.

If you have use of a non-linear editor, it may be quicker to do the splits using that.

I would place the original onto the timeline, find each "wrong" part, cut those out and place them on another row and save the project script. Then remove the original, leaving only the "wrong" parts. Cut out the gaps and save the rendered "wrong" parts together as a single file. I recommend extending the first segment back by a few frames and likewise adding a few extra frames to the last segment, as the AI tool clips a couple of frames from the start and end.

Then I'd halve and then AI double the fps of that file as above. And then re-import it into the saved project and replace the "wrong" parts with the corrected replacement scenes.
Pull the "wrong" parts out to another row

LigH
3rd January 2025, 11:16
Well, I asked specifically for a solution in Avisynth: To avoid GUI editors.

Dogway
3rd January 2025, 12:12
Depends on source, if the dups are for every frame, then selecteven() then interpolate with RIFE. If the dups are not consistent, I'd use TDecimate() or a dumb decimator like DeleteFrames() and then FillMissing() to interpolate larger gaps.

LigH
3rd January 2025, 12:59
In my case the drops were occasional and irregular, and the material in general rather shaky from a hand-held camera, so quite reliable detection of duplicates versus steady scenes, and very useable motion estimation. Selur gave me a perfect solution for my case.