View Full Version : Create interpolated frames
Bluedraft
17th April 2018, 05:39
Hi,
I just removed these 4 bad frames from a clip
DeleteFrame(110192, 110196, 110199, 110200)
Now I would need to fill those spaces with 4 interpolated frames in order to keep the clip smoothly in that portion, any idea how to do this?
Thanks in advance for any help.
StainlessS
17th April 2018, 10:03
Well firstly, you have now created a new clip and would have to recalc the bad [EDIT: Interpolate] frame numbers, or put back dummy frames into the original bad frame positions.
There are many scripts for doing as you wish (see the related thread a few threads after this one at time of posting, and containing links to other threads on same subject),
However, this is what I would choose.
First off, use original clip (pre-deletions).
FrameSurgeon:- https://forum.doom9.org/showthread.php?t=173158
Something like this
Avisource("...")
SCMD="""
I 110192
I 110196
I 110199
I 110200
"""
FrameSurgeon(scmd=SCMD,Final=True)
EDIT: Of course above script uses MvTools Interpolation not blends, dont know what Mounir is suggesting below.
Also, above will cope with thousands of frame replacments (no known upper limit, but limited to max 9 frames interpolated per replacement), whereas script in below post will likely screw up if more than about 70 or so replacements (although not limited by replacement length).
Mounir
17th April 2018, 11:47
if you want to create real frames not just blends use this:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\svpflow-1.0.6\svpflow1.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\svpflow-1.0.6\svpflow2.dll")
avisource()
ReplaceFramesSVPFlow(110192,1) # replace frame 110192, duration 1 frame
ReplaceFramesSVPFlow(110196,1) # replace frame 110196, duration 1 frame
## etc....
Function ReplaceFramesSVPFlow(clip Source, int N, int X)
{
# N is number of the 1st frame in Source that needs replacing.
# X is total number of frames to replace
#e.g. ReplaceFramesSVPFLow(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for SVPFlow interpolation
start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point
end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point
start+end
AssumeFPS(1) #temporarily FPS=1 to use mflowfps
super=SVSuper("{gpu:1}")
vectors=SVAnalyse(super, "{}")
SVSmoothFps(super, vectors, "{rate:{num:"+String(X+1)+", den:1}}", url="www.svp-team.com", mt=1).Subtitle("SVPFlow")
AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining
Trim(1, framecount-1) #trim ends, leaving replacement frames
Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0)
}
johnmeyer
17th April 2018, 15:54
You never said, in the original post, what reason you had for replacing those individual frames. If those frames are corrupted (blank, full of noise, photographer flash, etc.), I have a script that will automatically detect and replace (using motion estimated interpolation) those bad frames. Here is a link to the thread where I created the script:
Finding individual "bad" frames in video; save frame number; or repair (https://forum.doom9.org/showthread.php?t=174104)
Bluedraft
18th April 2018, 00:01
I'll tried those scripts. Thanks to all of you!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.