Quote:
Originally Posted by
sodaboy581 
MVTools really wasn't designed to be used in real-time and it's only because CPUs are so fast that we can do it, but with the settings on low.
Maybe some day when I can use MVTools with the highest settings and still be able to real-time "motion flow" the image, I'll perhaps use it all the time, 'cuz I do like smooth movement.

I'm glad to say that the new
MVTools 2.x (or direct link to
2.2.2 version) is faster and can be used with more agressive settings in real-time, at least with a C2D @ 3.0 GHz running movies with 300k pixels (ex.: 640x464).
The script I use now is:
Code:
setMTMode(2,3)
source=ffdshow_source()
LoadPlugin("C:\\Program Files (x86)\\AviSynth\\plugins\\mvtools2.dll")
super = source.MVSuper(pel=1)
backward_vec = MVAnalyse(super, blksize=8, overlap=0, isb = true, search=3, searchparam=5)
forward_vec = MVAnalyse(super, blksize=8, overlap=0, isb = false, search=3, searchparam=5)
source.MVFlowFps(super, backward_vec, ThSCD1=350, blend=false, forward_vec, num=2*FramerateNumerator(source), \\
den=FramerateDenominator(source))
distributor()
Note that 'blksize', 'search' and 'searchparam' are very agressive here, and it still works in real-time. There are some modifications in this new version, and new parameters, like 'blend=false', that doesn't blend (mix) frames at scene changes. The 'ThSCD1=350' parameter is a little tweak to better avoid some wrong scene change detection; I'm still working to find a better value, but at this moment I think that 350 is better than the default 400. Of course, you can set other values if you have a better (or worst) CPU; 'overlap', for example, can be set to 2 in order to improve the motion estimation, but it uses a little more CPU. Video card here doesn't make any difference (well, until someone port MVTools to CUDA, hehehe).
Also, I find out that MT.dll is not necessary (or, at least, no longer necessary). Just MT version of the Avisynth.dll is enough.
I discovered that in my case (a dual-core CPU) using more than 3 threads in the script cause some weird bugs. You can try
this sample to see. Set, for example, 5 threads (
setMTMode(2,5) ), use MPC and hit the RIGHT_ARROW (to advance frame by frame) until you reach a scene change. You'll notice that in the new scene the car moves some frames, then it 'stops' for a while, and then it continues to move again (in fact what happened is a wrong frame repetition). With 3 threads this bug doesn't occour.
Also, this bug disappear if you do any seek in the video. Can anyone confirm? Ah! Note that with 'blend=false' parameter it's normal that the
last frame of a scene repeats; there's no way to avoid this. The problem I'm talking about is the frame repetition in the
beginning of a scene.