View Full Version : SVP flow: is there better ?
Mounir
3rd March 2018, 21:03
Is there better in 2018 than svp flow for accurate image interpolation ? I need the less artefacts possible
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)
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
3rd March 2018, 22:27
MysteryX developed a script that adds masking. It was an attempt to do exactly what you are asking for. Click here to go to his script, but I also suggest you read this entire thread, and not just read this one post:
SVP-like frame interpolation? (https://forum.doom9.org/showthread.php?p=1805875#post1805875)
Mounir
4th March 2018, 00:51
hmm yeah i barely understand his code, but i don't need the convert to framerate; i only need to accurately interpolate frame B and taking frames A & C as references
raffriff42
4th March 2018, 02:11
You don't have to understand the code; calling FrameRateConverter with no options automatically interpolates in-between frames (from say 30fps to 60fps) with the best quality possible (in most cases).FFmpegSource2("your video")
FrameRateConverter
https://github.com/mysteryx93/FrameRateConverter/releases/
johnmeyer
4th March 2018, 04:41
hmm yeah i barely understand his code, but i don't need the convert to framerate; i only need to accurately interpolate frame B and taking frames A & C as referencesThere is actually no difference between changing framerate and interpolating between frames other than an AssumeFPS() call at the end.
Think about it: you have a (nominally) 30 fps progressive clip. You want to have it play in slow motion, at 50% normal speed. To do this, you interpolate a frame in between each existing frame. You then take this new video stream, which now has twice the number of frames, and as the last statement you add AssumeFPS(30). The video player will still play 30 frames per second, but since you now have twice as many frames, the video will play back at half speed.
Now assume you want that video to play at regular speed, but you want the much smoother cadence of 60 fps video. To do this, you once again do the exact same interporation where you interpolate a frame between each existing frame. You now have twice the number of frames. As the final line in your script you add AssumeFPS(60). You have twice the number of frames, but when you play this increased number of frames at twice the speed, the motion is normal speed, and it looks just like the original, except smoother, because you've added "tween" frames.
StainlessS
4th March 2018, 04:49
Looks to me like Raff and JM, both misinterpreted Mounir requirement to repair a range of frames by interpolation, rather than change framerate, eg tween dupes, replace dupes with tweened frames using unique frames either side of dupes as source.
EDIT: Mounir script function similar in functionality to this script taken directly from mvtools docs
# To recreate bad frames by interpolation with MFlowInter:
AVISource("c:\test.avi") # or MPEG2Source, DirectShowSource, some previous filter, etc
super = MSuper()
backward_vectors = MAnalyse(super, isb = true, delta=2)
forward_vectors = MAnalyse(super, isb = false, delta=2)
inter = MFlowInter(super, backward_vectors, forward_vectors, time=50, ml=70)
# Assume bad frames are 50 and 60
trim(0,49) ++ inter.trim(49,-1) \
++ trim(51,59) ++ inter.trim(59,-1) ++ trim(61,0)
johnmeyer
4th March 2018, 17:47
I may have missed that part of how his script works, but I am quite sure I did not misinterpret what he was asking.
The request he made in the body of his post was:
I need the less artefacts possibleSo, he wants a cleaner result.
Don't we all ...
He didn't seem to have any questions about how to replace ranges of clips, even though his script obviously is attempting to do that.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.