PDA

View Full Version : New to MVTools Functions


PolaR ID
23rd April 2009, 17:47
Hello All,

I'm very new to encoding and I want to learn how to use MVTools filter, spicially for now the Denoiseing part.

I know there is html file in the plugin folder which explain all function, i have read that as well and also the doom9 thread, some how the explanation in both for me is in advance level, hard to know. I tought to make thread in newbie section for help, if you guys please guide me in very simple words :p. Thanks in advance.

This is my simple script, I tried with this lines, which is in explanation.

MPEG2Source("C:\Documents and Settings\Polar ID\My Documents\Test\Test.d2v", cpu=2)
AssumeTFF()
Telecide()
TDecimate()

Crop(4, 58, -4, -58)
LanczosResize(640, 272)

backward_vec2 = source.MVAnalyse(isb = true, lambda = 1000, delta = 2)
backward_vec1 = source.MVAnalyse(isb = true, lambda = 1000, delta = 1)
forward_vec1 = source.MVAnalyse(isb = false, lambda = 1000, delta = 1)
forward_vec2 = source.MVAnalyse(isb = false, lambda = 1000, delta = 2)
source.MVDenoise(backward_vec2,backward_vec1,forward_vec1,forward_vec2,tht=10,thSAD=300)

All the time i get different kinds of error, don't know how to use it :confused:

Adub
23rd April 2009, 19:39
Why don't you post the exact errors that you are getting, and we can help your from there.

PolaR ID
23rd April 2009, 19:56
The fact is I don't know how to make script with MVTools, I use it in this way and i get error " I Don't Know What "source" means"

MPEG2Source("C:\Documents and Settings\Polar ID\My Documents\Test\Test.d2v", cpu=2)
AssumeTFF()
Telecide()
TDecimate()

Crop(4, 58, -4, -58)
LanczosResize(640, 272)

backward_vec2 = source.MVAnalyse(isb = true, lambda = 1000, delta = 2)
backward_vec1 = source.MVAnalyse(isb = true, lambda = 1000, delta = 1)
forward_vec1 = source.MVAnalyse(isb = false, lambda = 1000, delta = 1)
forward_vec2 = source.MVAnalyse(isb = false, lambda = 1000, delta = 2)
source.MVDenoise(backward_vec2,backward_vec1,forward_vec1,forward_vec2,tht=10,thSAD=300)

Blanchimont
23rd April 2009, 20:32
This is just a hunch, but put the following line between TDecimate and Crop:
source = last ...if the top functions must have processed the clip first(AssumeTFF(),Telecide(),TDecimate()). )
Otherwise source probably means this:
source = MPEG2Source("C:\Documents and Settings\Polar ID\My Documents\Test\Test.d2v", cpu=2)

Haven't used mvtools so this is new territory to me too, but the error means the 'source' parameter is not set, and source usually is input clip specified...

PolaR ID
23rd April 2009, 21:18
Than I get error, set compensation option (mc) in MVAnalyse.

LoRd_MuldeR
23rd April 2009, 22:15
You must use it like that:

source = MPEG2Source("C:\[...]\sam.d2v", cpu=2).AssumeTFF().Telecide().TDecimate().Crop(4, 58, -4, -58).LanczosResize(640, 272)
super = source.MSuper(pel=2, sharp=1)

backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=4)
backward_vec1 = super.MAnalyse(isb = true, delta = 1, overlap=4)
forward_vec1 = super.MAnalyse(isb = false, delta = 1, overlap=4)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=4)

return source.MDegrain2(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400)

PolaR ID
23rd April 2009, 22:35
source=MPEG2Source("C:\Documents and Settings\Polar ID\My Documents\sam\sam.d2v", cpu=2).LeakKernelDeint(order=1, threshold=10).Crop(4, 58, -4, -58).LanczosResize(640, 272).Tweak(sat=1.0)
super = source.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)

return source.MDegrain2(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400)

Still i gets error, there is no function no MSuper.

Very complicated :)

LoRd_MuldeR
23rd April 2009, 22:38
There is a function called MSuper() for sure. Please make sure "mvtools2.dll" is located in your Avisynth\Plugins folder!

PolaR ID
23rd April 2009, 22:40
I'm using single CPU, May i use the V2 of MVTools?

LoRd_MuldeR
23rd April 2009, 22:51
I'm using single CPU, May i use the V2 of MVTools?

Sure, why not?

PolaR ID
23rd April 2009, 23:19
Now it works fine after puting MVTools v2, thanks allot. I tought v2 is for Multi threaded CPUs :p.

Now I'm confuse, how I would make scripts myself :confused:

LoRd_MuldeR
23rd April 2009, 23:40
Now it works fine after puting MVTools v2, thanks allot. I tought v2 is for Multi threaded CPUs :p.

The Readme says that one of the goals in Version 2 of MVTools was improved stability in a "multithreaded environment with multicore CPU", but it definitely doesn't say that MVTools2 was developed for multicore systems only! More specifically MVTools2 itself doesn't appear to be multi-threaded. Anyway, Avisynth-MT may be used to speed-up MVTools2 ...

Now I'm confuse, how I would make scripts myself :confused:

Just like the example here:
http://forum.doom9.org/showpost.php?p=1277333&postcount=6

Basically all you need to do is adjusting the first line. Of course you can split that line into several lines for convenience...

PolaR ID
23rd April 2009, 23:46
Thanks allot once again,

One more thing to ask for today, if I want to use any other function of MVTools, how I will do that, for example if want to do some masking? with default parmeters.

LoRd_MuldeR
23rd April 2009, 23:52
All functions of MVTools2 are documented here, including examples:
http://avisynth.org.ru/mvtools/mvtools2.html

Note that most functions in MVTools2 need the "super" clip as one of their parameters. So you will need to call MSuper() on your source clip first in order to obtain the "super" clip.

PolaR ID
24th April 2009, 00:09
is this the right way to do?
source = MPEG2Source("C:\[...]\sam.d2v", cpu=2).AssumeTFF().Telecide().TDecimate().Crop(4, 58, -4, -58).LanczosResize(640, 272)
super = source.MSuper(pel=2, sharp=1)

backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=4)
backward_vec1 = super.MAnalyse(isb = true, delta = 1, overlap=4)
forward_vec1 = super.MAnalyse(isb = false, delta = 1, overlap=4)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=4)

return source.MDegrain2(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400)
vectors = MSuper().MAnalyse(isb = false)
MMask(here I must had MMask parmeters? instad of vectors)

LoRd_MuldeR
24th April 2009, 00:16
From the example, slightly adjusted:

source = MPEG2Source("C:\[...]\sam.d2v", cpu=2).AssumeTFF().Telecide().TDecimate().Crop(4, 58, -4, -58).LanczosResize(640, 272)
vectors = source.MSuper().MAnalyse(isb = false)
return source.MMask(vectors)

Combined with MVDegrain:

source = MPEG2Source("C:\[...]\sam.d2v", cpu=2).AssumeTFF().Telecide().TDecimate().Crop(4, 58, -4, -58).LanczosResize(640, 272)
super = source.MSuper(pel=2, sharp=1)

backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=4)
backward_vec1 = super.MAnalyse(isb = true, delta = 1, overlap=4)
forward_vec1 = super.MAnalyse(isb = false, delta = 1, overlap=4)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=4)

degrained = source.MDegrain2(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400)

vectors = degrained.MSuper().MAnalyse(isb = false)
return degrained.MMask(vectors)

But I'm not sure if doing it like that, first run MVDegrain() and then apply MMask() on the degrained version, is a good idea ;)

PolaR ID
24th April 2009, 00:42
But I'm not sure if doing it like that, first run MVDegrain() and then apply MMask() on the degrained version, is a good idea ;)

Hmn, hope some one make this clear for me.

how can i work with Defaults params for MMask?

Defaults are : kind = 0, ml = 100, gamma = 1.0, and Ysc = 0.

When and how is good idea to use MMask and in which way?

LoRd_MuldeR
24th April 2009, 00:51
how can i work with Defaults params for MMask?

Don't specify these optional parameters and then the defaults will be used ;)

When and how is good idea to use MMask and in which way?

I think this highly depends on what you are trying to achieve...

PolaR ID
24th April 2009, 01:11
I'm not sure i did understand right or not, but if i do first MVdegrain,in here the MVDegrain already creat some kind of spiacial mask on clip? and if I now do on the degraind version, MMask... this will creat some kind of artefacts or any other prob on the output?

Sorry for bad Eng.

LoRd_MuldeR
24th April 2009, 01:52
The purpose of MDegrain() is to remove grain from the video without destroying details. The purpose of MMask() is to create a motion mask. I don't know what that mask is good for exactly, but I think it's only useful as input for other filters. Now the question is whether it is preferable to generate the mask from the original source or from the degrained one...

In case you want to degrain the video, but calculate the mask based on the original (not degrained) clip, you can do it like that I think:

source = MPEG2Source("C:\[...]\sam.d2v", cpu=2).AssumeTFF().Telecide().TDecimate().Crop(4, 58, -4, -58).LanczosResize(640, 272)
super = source.MSuper(pel=2, sharp=1)

backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=4)
backward_vec1 = super.MAnalyse(isb = true, delta = 1, overlap=4)
forward_vec1 = super.MAnalyse(isb = false, delta = 1, overlap=4)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=4)

degrained = source.MDegrain2(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400)
return degrained.MMask(forward_vec1)

PolaR ID
26th April 2009, 11:11
As the default thSAD is 400, if I want lower value, how I count it to get 8x8 block size?

You must enter thSAD value reduced to block size 8x8. Low values can result in staggered denoising, large values can rezult in ghosting and artefactes.

PolaR ID
26th May 2009, 22:55
How to make the script in this mod

MPEG2Source("C:\Documents and Settings\Polar ID\My Documents\Test\Test.d2v", cpu=2)
AssumeTFF()
Telecide()
TDecimate()

Crop(4, 58, -4, -58)
LanczosResize(640, 272)

Not this way,
source = MPEG2Source("C:\[...]\sam.d2v", cpu=2).AssumeTFF().Telecide().TDecimate().Crop(4, 58, -4, -58).LanczosResize(640, 272)
super = source.MSuper(pel=2, sharp=1)

backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=4)
backward_vec1 = super.MAnalyse(isb = true, delta = 1, overlap=4)
forward_vec1 = super.MAnalyse(isb = false, delta = 1, overlap=4)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=4)

return source.MDegrain2(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400)

because some time when i add to many filters I can't see the last ones using avsp.

neuron2
27th May 2009, 00:32
@PolaR ID

Please do not delete threads after others have replied. Thank you.