PDA

View Full Version : question on slow motion using mvtools


mgh
3rd June 2007, 16:13
I used the following function to get slow motion

Function slowdown( clip clip, int c ) {
# c is the slowdown factor
fn=FramerateNumerator (clip)
fd=FramerateDenominator(clip)
b=fd*c
source=assumefps(clip,fn,b).killaudio()
backward_vec = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
forward_vec = source.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
cropped = source.crop(4,4,-4,-4) # by half of block size 8
backward_vec2 = cropped.MVAnalyse(isb = true, truemotion=true, pel=2, idx=2)
forward_vec2 = cropped.MVAnalyse(isb = false, truemotion=true, pel=2, idx=2)
return source.MVFlowFps2(backward_vec,forward_vec,backward_vec2,forward_vec2,num=fn,den=fd,idx=1,idx2=2)
}

To my surprise, I found that the script also did excellent denoising.
Could one get temporal denoising without blending of frames by using above function as follows?

slowdown(2)
selectodd()
assumefps(original fps)

foxyshadis
3rd June 2007, 16:55
Look just a little further and you'll find MVDegrain1 & 2, which take care of all the particulars for you. ;)

mgh
4th June 2007, 21:24
Have been using mvdegrain2 for some time now. My tests had shown approx.10 to 15 % improvement in compressibility with mvdegrain1 and approx. 25 % with mvdegrain2.

I made an addition to my earlier script as follows

Function cleanmv( clip clip, int c ) {
fn=FramerateNumerator (clip)
fd=FramerateDenominator(clip)
b=fd*c
d=c/2
d=int(d)
source=assumefps(clip,fn,b).killaudio()
backward_vec = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
forward_vec = source.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
cropped = source.crop(4,4,-4,-4) # by half of block size 8
backward_vec2 = cropped.MVAnalyse(isb = true, truemotion=true, pel=2, idx=2)
forward_vec2 = cropped.MVAnalyse(isb = false, truemotion=true, pel=2, idx=2)
vid=source.MVFlowFps2(backward_vec,forward_vec,backward_vec2,forward_vec2,num=fn,den=fd,idx=1,idx2=2)
vid=selectevery(vid,c,d)
vid=assumefps(vid,fn,fd)
return vid
}

Tried the function with values of the parameter from 2 to 10. Still to check compressibility, but it seems to be better at removing artefacts such as grainy edges than mvdegrain 1 &2 and much faster.