View Full Version : MVtools multiple slowmo codes in one file
DumbnutzProd
5th January 2012, 17:22
Hey there, party people!
I'm using Virtualdub + MVtools (both Versions) and love the possibilities you have with these two combined.
Problem is:
I can't for the heck of it make a script that works on ANY Framerate, Video size, etc.; I'm working for almost a year on a script that uses multiple entries of the same kind and then just runs thru that multiple times, and in the End uses the "gathered" footage to apply the "final" slowmotion.
What I have tried is:
1. Make LOTS of script files, that all contain the same basic script, run then one after another, and finally make a "completion" script. Problem is: each script the denominator goes up by X* (amongst what I used alot was: last.MVFlowfps(backward_vec,forward_vec,num=2*frameratenumerator(source), den=frameratedenominator(source), idx=1)), after 10 files you end up with a insanely high FPS AND filesize.
2 Make ONE script, but include many functions of the same type, and at the "bottom" "make" the video itself. That's what I used the last time.
It goes something like this:
I have alot of:
back1 = last.MVAnalyse(overlap=2,overlapv=2, isb = true, pel=2, search=5, searchparam=3, idx=1)
forw1 = last.MVAnalyse(overlap=2,overlapv=2, isb = false, pel=2, search=5, searchparam=3, idx=1)
last.MVFlowfps(back1,forw1, num=int(frameratenumerator(source)*1000))
each with different Variable names, back2, back2b, back2c, back3 for example, and also differenz block sizes, etc.
NOW: it seems to TAKE all of these to account, but in the end, when I make the video with the Top script (last.MVFlowfps(backward_vec,forward_vec,num=10*frameratenumerator(source), den=frameratedenominator(source), idx=1)), it seems only slightly "better" than when I just use the FIRST code I posted, with 2*frameratenumerator.
HOW can you make ONE file, with MANY functions (MRecalculate, MVAnalyse, etc.), that ONLY sum up together, and are taken into account when rendering the final file (with MVFlowfps for example)
Shorter:
Make many codes with high "slowmotion settings", and THEN use them ALL when actually rendering/exporting the file.
I THINK my error is trying it like that, because I'm thinking, when you make 1 Video file with 2* slowmotion (or half speed, lol), then another one and another one, the others are "fixing" the "missing" parts that would usually produce artifacts/glitches/be jumpy; but I can't get a smooth movement for EVERYTHING in the Video.
What I have right now produces the following example movie:
There is a car driving, and you see the wheels spinning, ok?
The CAR itself moves (200+FPS after encoding) perfect, no glitches, and the interpolation is perfect.
The WHEELS of the car (the spinning motion of the rims) has NO artifacts, but the movement is "sketchy", short again:
BIG objects are perfectly interpolated, even when moving rather fast. Smaller, fast movement is sketchy (like there is 2-5 Frames missing in that particular area).
Somebody know's what function catches small movements and interpolates them?
All you can find about mvtools is either half-copypasted codes from the documentation, or script that use actual functions (like:
function slowmo { blablacode return blabla}.).
I understand the coding of all that, but I'd rather have a clean, step by step-script, like:
1 - Interpolate
2 - Interpolate
3 - Interpolate
4 - Interpolate
5 - Interpolate
6 - Make final video using 1-5 as reference.
Thx in advance, and I hope you aren't too puzzled from what I wanted to ask, lol.
Gavino
6th January 2012, 10:39
I've read your post several times and I still don't understand it.
And since nobody else has replied, I'm probably not alone in this.
What are the five interpolation steps?
Do you have 5 different sources, five different sections of the same source, or what?
Perhaps you want each section to be a different 'speed'?
Try again, explaining
- what your input is
- what you want the output to be
DumbnutzProd
6th January 2012, 14:18
THX Gavino, you ALMOST got it right what I tried to say:
"Do you have 5 different sources, five different sections of the same source, or what?"
Not 5 different sources, but FIVE DIFFERENT SECTIONS FOR 1 SOURCE, so you got that one right, lol :)
"Perhaps you want each section to be a different 'speed'?"
Tried that, and then a video with 15 seconds lenght takes 12 Hours to render.
BUT maybe THAT is what I NEED, each section a different speed, and then in the end, make the speed I really want the output to have?
Ok, I will post it this way then:
source=AVISource("XXX").ConvertToYUY2() (WHERE XXX is a new, different video each time)
then the interp. steps:
back1 = last.MVAnalyse(overlap=2,overlapv=2, isb = true, pel=2, search=5, searchparam=3, idx=1)
forw1 = last.MVAnalyse(overlap=2,overlapv=2, isb = false, pel=2, search=5, searchparam=3, idx=1)
last.MVFlowfps(back1,forw1, num=int(frameratenumerator(source)*1000))
back2 = last.MVAnalyse(overlap=2,overlapv=2, isb = true, pel=2, search=5, searchparam=3, idx=1)
forw2 = last.MVAnalyse(overlap=2,overlapv=2, isb = false, pel=2, search=5, searchparam=3, idx=1)
last.MVFlowfps(back2,forw2, num=int(frameratenumerator(source)*1000))
... and so on until back5 and forw5, then the FINAL STEP:
backward = last.MVAnalyse(overlap=4, isb = true, pel=2, search=3, idx=1)
forward = last.MVAnalyse(overlap=4, isb = false, pel=2, search=3, idx=1)
last.MVFlowfps(backward,forward,num=10*frameratenumerator(source), den=frameratedenominator(source), idx=1)
As I wrote, steps 1-5, then FINAL MVFlowfps.
But I just want to know, if that is an logical error, thinking that multiple MVFlowfps, and THEN at the END making a final Interpolation with the others added to it will increase the smoothness. How should I explain what I want?
I want my input to be "recalculated/interpolated" to a higher FPS MULTIPLE TIMES, and then the output SHOULD have a SMOOTHER, high FPS, but as I said, I start to think that this is a logical error I made, but doing the interpolation like that seems logical, and unlogical at the same time.
Can you use multiple MVFlowfps, in the SAME AVS-script, and are they even taken into account?
Right now, it looks like it TAKES (as I wrote) all 6 (or 5) interpolations, but only applies half of it.
What other function is good for smooth, high-FPS interpolation?
SmoothFPS function is sh*te, so is the Mvtools2 "MRecalculate" option (THAT one looks REAL sketchy, jumpy, and FAR from smooth).
Michael Lugo
7th January 2012, 22:40
Although it's hard to be sure what exactly you're doing without seeing your full script, the reason that nothing appears to be happening is because you are using multiple mvflowfps with the same target framerate.
In other words, you are taking your source, interpolating its frame rate TO source*1000 (say, if your source's framerate numerator is 30,000, the new one would be 30,000,000). Then you're interpolating the resulting 30,000,000/x video to have a new framerate of...30,000,000/x. The frame rate does not change, so mvflowfps does nothing. If you were to have each successive call set its numerator to frameratenumerator(last) * 1000 rather than source * 1000, each one would then interpolate the last to a higher frame rate.
However, using multiple calls of mvflowfps is also far less efficient (and ultimately more likely to cause artifacting) than a single call which is set to your desired goal frame rate. You'd also probably be better off using mflowfps from mvtools2.
But again I'm not sure what you're actually intending. What you have, if it worked (i.e. 5 calls with num=frameratenumerator(last)*1000), would create a video that had a framerate of 1,000,000,000,000,000 times the original.
What you have now interpolates fps to source*1000, then at the end interpolates that back down to source*10, which is likely responsible for a lot of the "sketchiness" you see. Also, you would likely have less artifacting with a smaller blocksize, and additionally making use of the dct property.
Here is my interpretation of what you want:
AVISource("XXX").ConvertToYUY2()
super = msuper(sharp=2)
bv = super.manalyse(blksize=4, overlap=2, delta=1, isb=true, search=5, dct=5, truemotion=true)
fv = super.manalyse(blksize=4, overlap=2, delta=1, isb=false, search=5, dct=5, truemotion=true)
mflowfps(super, bv, fv, num=frameratenumerator(last) * 10, den=frameratedenominator(last))
DumbnutzProd
8th January 2012, 12:31
Hey THX Michael, you GOT IT!
I did some fiddling, and you are indeed right, as I feared:
It takes the same Framerate over and over, and just everytime makes it *1000, so it doesnt actually take over all these steps;
to actually USE that function, I'd have to use 10 functions with 100* each, to actually achieve a *1000 slowmo.
So short again:
a video with 500 frames would end with billions of frames, and a therefore EXTREMELY high fps, which makes sense: you cannot interpolate frames without adding to the fps, I knew about that, but it escaped my mind.
Anyway, what you got, I'll look at it and THANK YOU VERY much.
Lol, I had fft3.dll and also mvtool2, but never used "super" that much, since my experimenting with MRecalculate (or whatever it was called) made my vids even sketchier.
DumbnutzProd
29th January 2012, 13:43
Ok, I still didn't give up on it.
LoadPlugin("C:\vdub\plugins\mvtools.dll")
AVISource("C:\XXX.avi").ConvertToYUY2()
source=AVISource("C:\XXX.avi").ConvertToYUY2()
f1=FrameRatenumerator(source)*2
f2=FrameRatenumerator(source)*4
f3=FrameRatenumerator(source)*6
f4=FrameRatenumerator(source)*8
f5=FrameRatenumerator(source)*10
######################################
a1 = last.MVAnalyse(blksize=8, overlap=2, search=5, dct=5, isb = true, pel=2)
a2 = last.MVAnalyse(blksize=8, overlap=2, search=5, dct=5, isb = false, pel=2)
last.MVFlowfps(a1,a2,num=int(f1), den=frameratedenominator(source))
b1 = last.MVAnalyse(blksize=8, overlap=2, search=5, dct=5, isb = true, pel=2)
b2 = last.MVAnalyse(blksize=8, overlap=2, search=5, dct=5, isb = false, pel=2)
last.MVFlowfps(b1,b2,num=int(f2), den=frameratedenominator(source))
c1 = last.MVAnalyse(blksize=4, overlap=2, search=5, dct=5, isb = true, pel=2)
c2 = last.MVAnalyse(blksize=4, overlap=2, search=5, dct=5, isb = false, pel=2)
last.MVFlowfps(c1,c2,num=int(f3), den=frameratedenominator(source))
d1 = last.MVAnalyse(blksize=4, overlap=2, search=5, dct=5, isb = true, pel=2)
d2 = last.MVAnalyse(blksize=4, overlap=2, search=5, dct=5, isb = false, pel=2)
last.MVFlowfps(d1,d2,num=int(f4), den=frameratedenominator(source))
e1 = last.MVAnalyse(blksize=4, overlap=2, search=5, dct=5, isb = true, pel=2)
e2 = last.MVAnalyse(blksize=4, overlap=2, search=5, dct=5, isb = false, pel=2)
last.MVFlowfps(e1,e2,num=int(f5), den=frameratedenominator(source))
Was one of my verrrry first Codes.
See, where it uses 5 Codes, doubling the Frames each time?
a Series does it 2x, down to e Series, which does it 10. I did it that way to conserve a linear increase, while using num=0 or FrameRatenumerator(last)*2 on each would produce a output with actual 32x (1x2=2, 2x2=4, 4x2=8, 8x2=8, 16x2=32), and I wanted it to be 10.
Effectively, this method is sh*t. The codes (or what would you call each section? Scripts? Functions? They aren't functions, scripts would be *.avs files, so lets call them codes.) seem to conflict, since they are all taken in account in the final 10* processing, but it produces a lot of sketchiness, and other weirdnesses.
Now what I have is 1 Script:
a1 = last.MVAnalyse(blksize=4, overlap=2, search=5, isb = true, pel=2, idx=1, dct=10, truemotion=true, delta=1)
a2 = last.MVAnalyse(blksize=4, overlap=2, search=5, isb = false, pel=2, idx=1, dct=10, truemotion=true, delta=1)
return last.MVFlowfps(a1,a2,num=int(f1), den=frameratedenominator(source), idx=1)
And that script is called via a very complicated Batch file, which also serves to rename and delete the temp files, if I may explain (all given names are just examples):
A.avi is my "avisource".
Atmp.avi is my "temp video file" created after virtualdub ends the rendering.
I start the bat, which checks for "Atmp.avi", which isn't there yet (the original hasn't been processed yet) and starts the *.avs script. The output created with virtualdub (Atmp.avi) is basically a temp movie, which is basically the finished movie but only with a (yet) low framerate. Then the bat deletes the input (A.avi), renames the temp (Atmp.avi) to the correct name and starts the same script again, so it is: check for Atmp, if exist delete A.avi and ren Atmp to A.avi.
That get's repeated until it reaches 5 passes; now, we still have a 32x higher framerate (as I wrote above, it goes 1x2=2, 2x2=4, 4x2=8, 8x2=8, 16x2=32), BUT:
It is much smoother (thanks to the processing, renaming the output, and using it as the new input and then reprocessing it, etc. and so on), and not choppy at all, everything is fluid as it should be.
Just my thinking, but you can't use multiple codes like Mvflowfps or so in the same avs, since though the processing is slowed down, it still messes up. Better to create a output, and then use that output as the NEW input, and reprocess it, until you've got it "slow" enough, meaning you interpolated the framecount high enough :)
Didée
29th January 2012, 14:30
Since you're obviously using the old v1.x branch of MVTools, I suspect your problems are rather related to "idx" usage. Consider switching to MVTools v2, having a more transparent handling of the subpel clips, via the "super" clip parameter.
DumbnutzProd
30th January 2012, 14:43
Since you're obviously using the old v1.x branch of MVTools, I suspect your problems are rather related to "idx" usage. Consider switching to MVTools v2, having a more transparent handling of the subpel clips, via the "super" clip parameter.
Thx for the advice;
although, I WAs using super with MVTools2 alot, but somehow there is little difference (processing speed and quality-wise) between some functions from MVTools and the v2 Version.
I went back to super once again, and there you have it; little difference, the output is still silky-smooth (WITH THE BATCH-Method I explained earlier);
when you'd do num=32*FramerateNumerator(last), you'd get sketchiness (no matter if MVtools or v2 with "super"), whereas
num=2*FramerateNumerator(last) combined with my batch-Method (repeated until it also reaches a total of 32*Frameratenumerator, which would be 5 passes) makes a perfect output, no matter if MVTools 1 or 2.
Also, idx has no impact in the method I use (batch-Method), if you'd use a huge multiplier like 100*FramerateNumerator, I don't know if it screws that up, but meh;
Batch-executing the scripts (I lied, I use 2 different scripts now) one after another and then repeat until dry works for me, it is time consuming, but the best output quality-wise, AND you could always say "ONCE MORE! Interpolate, HARDER!" or "That'll do pig, that'll do."
Didée
30th January 2012, 15:10
With your batch method, idx indeed is not concerned, because each sucessive script instance is completely independent from the previous. I was referring to your earlier posts, where you had the MVFlowFPS chained up in one script. In some posts I think I saw wrong idx usage, which perfectly eplains "erroneous" results. Not specifying idx at all would be correct, too, but then the chain is likely to explode from excessive memory usage. (idx=-1 (inherent, automatic) creates a new subpel clip everytime, even when not needed.)
From a general point of view, there's little reason why such multi-step MFlow should deliver "better" results than doing it in just one step. It stands and falls mostly with the very-first instance of MAnalyse:
- If the 1st instance catches motion correctly, then there is no problem, and even high-fps interpolations should be correct.
- if the 1st instance does NOT catch motion correctly, then the error is introduced. Subsequent instances will only "refine" the motion error created in the 1st instance.
Depending on kind of source and kind of motion, there's always the possibility that one method will work out a little different than the other. But in general, it's really that simple: if the 1st MFlow created some "false" motion, then all subsequent instances will do their work based on the damage introduced in the 1st instance.
If you can show an example where the multi-step batch method gives a clearly superior result, I would be interested to see a sample. :)
DumbnutzProd
30th January 2012, 20:53
Yeah, I finally surrender to MVTools;
further testing ALL OF A SUDDEN produced different results; artifacts, skipped frames, repeated/jumpy frames, the usual glitchyness.
If I deleted the vid and started again using the same input and same method, no glitches.
But I don't have the time to "try for good", until the video turns out good enuff; long story short:
I'm using a 16* frameratedenominator.
And about the "not catching correctly": You are absolutely right, and that's what just now happened, I think. As I said, my method WAS working, but all of a sudden I had to try it 3 times until I got a perfect result again.
Needless to say, it takes a good 20 mins to encode 1 minute of footage, that's some major fail from my side, since if it fails, I'd have to restart from scratch.
Meh, thanks for all yer help, but I just threw all the stuff I was using into the bin and now just use 1 script instead :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.