View Full Version : Need help with MVTools
dansrfe
18th May 2009, 00:51
Hey guys I'm a n00b on installing and using complex filters. Can anyone please help me and put me in the right direction as to how to use all of MVTools and especially MVDegrain3? I would appreciate if someone can post a step by step on what dlls to install and what the syntax is and what the syntax parts mean in MVTools. I know basic scripting but thats about all and i want to be able to use more complex filters. Also if someone can suggest something for macroblocking also that would be great as well. Thanks in advance.
onesloth
18th May 2009, 02:16
Hey guys I'm a n00b...
http://avisynth.org.ru/mvtools/mvtools2.html
dansrfe
18th May 2009, 22:35
Unfortunately I can't understand what is on that page either :( I need some easier instructions.
onesloth
19th May 2009, 01:48
That's the only place you're going to find documentation that explains MVTools' syntax. Frankly, those docs are some of the best you are gonna find among any avisynth filters. They have detailed examples of many different ways to use the functions. You would be hard pressed to find another developer that makes it as easy as selecting the example that suits your needs, then copy and pasting.
Blue_MiSfit
19th May 2009, 20:00
It's pretty simple. The MVTools documentation is dense for sure. However, if you parse through it, you'll see lots of examples towards the end.
I'll hold your hand - just because I'm in a nice mood today :)
Installing MVTools is very simple. Just download the latest version from avisynth.org.ru and move the MVTools2.dll into your AviSynth plugins folder.
Using MDegrain (not called MVDegrain anymore) is also pretty simple. Here's an example script
MPEG2Source("movie.d2v")
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
The parameter that controls the denoising strength is thSAD. The default of 400 is very good in most cases, though I go as high as 800 or even 1200 on some really really grainy sources.
If you have a multi-core CPU, then you should definitely install MT Avisynth, and use MDegrain2 in MT mode, like this:
MPEG2Source("movie.d2v")
MT("""
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
""",2)
This will use two threads, which is usually enough to get utilization up to 100% even for a quad-core CPU. I sometimes go as high as 4 threads though.
If you want to compare the results of before/after MDegrain2, then try something like this:
MPEG2Source("movie.d2v")
a=last
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
interleave(a,last)
histogram(mode="luma")
This will give you an exaggerated luma histogram, which I always use for tweaking denoising parameters. You can comment out the Histogram... filter to see the real image.
Good luck! Be ready for slow encoding times but fantastic quality!!
~MiSfit
BigDid
19th May 2009, 22:24
Hi Misfit,
Thanks for your hand holding, atm I am at page 19 of the MVTools thread and reading :eek:
I have much more questions than answers but I will hold until reading is finished :scared:
1 little question though: comparing with FFT3d/filter/gpu(), does Mdegrain1() have better quality than fft3d or is it needed to use Mdegrain2() and have more loss in speed?
Example for Mdegrain1() re-written, hopefully correct:
super = MSuper() # no pel, no sharp
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=2) # overlap only 2, faster?
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=2) # 1 vector (frame?) backward, 1 vector forward only, twice as fast?
MDegrain1(super, backward_vec2,forward_vec2,thSAD=400) #same thSAD strentgth
Did
Blue_MiSfit
19th May 2009, 22:41
Hard to say.
The interesting thing about fft3dgpu is that it can be EXTREMELY powerful, while being basically real-time on a good GPU.
MDegrain2 is kind of the gold standard, in that it's capable of delivering a huge compressibility boost without hurting the image too much. FFT tends to posterize / (create banding in) the image at high strengths, and usually requires dithering to keep things under control. It can also soften things a lot when pushed too far. It's very important to tune the 4 sigma values. I usually do a simple curve, like sigma=1, sigma2=1.5, sigma3=2, sigma4=1.
MDegrain2 can result in temporal problems when you push the thSAD really high, but it's usually manageable.
If I need to clean a source lightly (or just clean chroma noise) I always use fft3dgpu. If I need to really do some proper denoising, then MDegrain2 is usually my go-to guy.
~MiSfit
dansrfe
19th May 2009, 23:23
It's pretty simple. The MVTools documentation is dense for sure. However, if you parse through it, you'll see lots of examples towards the end.
I'll hold your hand - just because I'm in a nice mood today :)
Installing MVTools is very simple. Just download the latest version from avisynth.org.ru and move the MVTools2.dll into your AviSynth plugins folder.
Using MDegrain (not called MVDegrain anymore) is also pretty simple. Here's an example script
MPEG2Source("movie.d2v")
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
The parameter that controls the denoising strength is thSAD. The default of 400 is very good in most cases, though I go as high as 800 or even 1200 on some really really grainy sources.
If you have a multi-core CPU, then you should definitely install MT Avisynth, and use MDegrain2 in MT mode, like this:
MPEG2Source("movie.d2v")
MT("""
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
""",2)
This will use two threads, which is usually enough to get utilization up to 100% even for a quad-core CPU. I sometimes go as high as 4 threads though.
If you want to compare the results of before/after MDegrain2, then try something like this:
MPEG2Source("movie.d2v")
a=last
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
interleave(a,last)
histogram(mode="luma")
This will give you an exaggerated luma histogram, which I always use for tweaking denoising parameters. You can comment out the Histogram... filter to see the real image.
Good luck! Be ready for slow encoding times but fantastic quality!!
~MiSfit
AMAZING!!! :eek: Thank you so much Blue_MiSfit :thanks: Your explanation was extremely clear to me. The quality of the filter is very, very good and the denoising is quite spectacular in terms of effectiveness. Btw, is there any problems with this filter removing details at the default value of 400?
onesloth
20th May 2009, 01:18
I'll hold your hand - just because I'm in a nice mood today :)
Bah. "...give a man a fish...":rolleyes:
...does Mdegrain1() have better quality than fft3d or is it needed to use Mdegrain2() and have more loss in speed
In my experience, for most modern grainy HD sources, MDegrain1 gets you a significant boost in compressibility, but doesn't really remove *all* the grain. That is, you'll still see noise in flat areas. MDegrain2 usually improves compressibility by about 10-15% over MDegrain1 and typically removes the rest of the noise you can see. But you should really just experiment for yourself and decide what works for you.
For me, using fft3d, at settings that give the same compressibility as MDegrain1, results in too much banding and detail loss.
BigDid
20th May 2009, 22:48
Hard to say.
...
It can also soften things a lot when pushed too far. It's very important to tune the 4 sigma values. I usually do a simple curve, like sigma=1, sigma2=1.5, sigma3=2, sigma4=1.
See more below from my first tests.
Concerning Fft3d could you give some equivalent; if I use a simple sigma=2 and/or sigma=3 how will it translate for sigma/sigma2/sigma3/sigma4 ?
Wil it go (for sigma=2) to sigma=2, sigma2=3, sigma3=4, sigma4=2
and for sigma=3 to sigma=3, sigma2=4.5, sigma3=6, sigma4=3 ?
MDegrain2 can result in temporal problems when you push the thSAD really high, but it's usually manageable.
Yes I think I am flirting with the temporal limit at thSAD=1400 but, for that movie, I don't want to go Mdegrain3() and for the complete filter chain, the 2 pass total encoding time is already around 9hours :eek:
===================================================================
...
For me, using fft3d, at settings that give the same compressibility as MDegrain1, results in too much banding and detail loss.
My first tests tends to confirm that also.
... MDegrain2 usually improves compressibility by about 10-15% over MDegrain1 and typically removes the rest of the noise you can see. But you should really just experiment for yourself and decide what works for you.
Yes, even if I seem to have reached the limits for a bad source; see above
Anyhow I also have a bad source I want to rework (Point Break) so I will see if I use Mdegrain2() to the limit or if Mdegrain3() is really worth the time loss :D
Did
Edit: Point break is really bad for noise AND for blocks; working on a strong deblocking solution. Mdegrain3 is nearly at max: thSAD=1200 ! will have a look at Mcspuds and/or Temporal denoise
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.