Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th November 2005, 22:26   #61  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
@Fizick: The doc section wasn't as much aimed at you, as it was to some helpful soul wishing to help out. This is a great package, but it still requires solid code and very good documentation. I'm sure you can help with the solid code, as you've already turned Manaos basecode into something very useful!

I think the concepts and parameters are difficult to understand, and even harder to control. This is not a design problem as such, but it requires a lot more documentation to be easy to use. Compare it to Telecide. A "simple" function, but it still it requires massive documentation to ensure that it's useable. MvTools are rather fast becoming just as useful.

Maybe it would be a good idea to open a section on avisynth.org?
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 14th November 2005, 23:20   #62  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
May be some parameters can be renamed or rescaled, but I do not want to do it (and do not want ask Manao to do it) without really big needs (as I do for "showsad"), to not broke existing scripts.
Fizick is offline   Reply With Quote
Old 15th November 2005, 20:56   #63  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
v0.9.12.4 (Released 15.11.2005)
Changed type of ml parameter in MVMask, MVFlowInter, MVFlowFps from int to float.
Added bound check of ml, time, blur parameters.
Small possible bug fixed (emms).
Partially updated documentation. But I am not sure that sh0dan requested exactly such updating . It is still not user guide but functions reference.
Fizick is offline   Reply With Quote
Old 16th November 2005, 07:43   #64  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Gent, Flanders, Belgium, Europe, Earth, Milky Way,Universe
Posts: 663
Hello Fizick,

MVFlowFps works very very fine
I did some first tests on this slow (600mgz) machine.

No blocks anymore!
But sometimes 'rubber' artifacts like with Motion Perfect.

I used this script:

Code:
Loadplugin("MVTools.dll")
Loadplugin("Depan.dll")
Loadplugin("fft3dfilter.dll")
Loadplugin("degrainmedian.dll")


source=avisource(film).assumefps(16).converttoYV12()
clipC=DeGrainMedian(source,limitY=5,limitUV=10,mode=2)
clipD=FFT3DFilter(clipC,sigma=2,sharpen=1.0)

backward_vectors = clipD.MVAnalyse(isb = true, lambda = 1000, lsad=1000, pnew=50, pel=2)
forward_vectors = clipD.MVAnalyse(isb = false, lambda = 1000, lsad=1000, pnew=50, pel=2)
frameclip=MVFlowFps(clipD,backward_vectors, forward_vectors, num=25, den=1, ml=100) 

mdata=DePanEstimate(frameclip,trust=0)
stab=DePanStabilize(frameclip,data=mdata,cutoff=1.0)

stab
Now I must test it at home on my fast (3Ghz) machine.
I think it's gonna run faster than the original MVTools

And I'm gonna compare MVConvertFps with MVFlowFps.

But I do not understand the use of the 'den' parameter???
I mean, 'num=50, den=2' is the same as: 'num=25, den=1'
Both are giving me a result file with 25fps.
What's the difference?

I have another question, too:
Dynapels Videoscope tells me ALL the frames are originals!
This means MVFlowFps and MVConvertFps creates complete new frames, right?




Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest

Last edited by videoFred; 16th November 2005 at 08:05.
videoFred is offline   Reply With Quote
Old 16th November 2005, 16:27   #65  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,455
There is no difference, FpS always = num/den. For PAL it's not so important, but with NTSC it has to be num=30000, den=1001 because both are integer values. (Any other franctional fps the same.)
foxyshadis is offline   Reply With Quote
Old 16th November 2005, 20:37   #66  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
videoFred,
thanks!
I am very interested in old 8mm film conversions too.

1)If you want, some frames will be old, when you set fps relation to some simple relation.
For example, you can change source fps from 16 to 16.66666 (=50/3) so way:
AssumeFps(50,3)

2) Yes, MotionPerfect probably uses similar algo.

MVFlowFps is experinental. DePan gives more stable result.

As a workaround, we can try use block overlap.
Try this my function:

Code:
loadplugin("blockoverlap.dll")
loadplugin("mvtools.dll")

function OverlapFps(clip source, int "num", int "den", int "ml", int "blksize", float "kernel", int "lambda", bool "chroma", int "pel", int "thSCD1", int 

"lsad",int "pnew") 
{
# Overlapped block motion fps conversion by shifted clips processing and windowed blending  
# Fizick, 2005
# Uses MVTools v0.9.12.4 plugin by Manao & Fizick
# Uses BlockOverlap v0.2 plugin by Fizick 
# source clip must have YV12 format,
# all other parameters are optional
# new fps = num/den
num=default(num,25) # numerator
den=default(den,1) # denominator
ml=default(ml,100) # mask scale
blksize=default(blksize,8)
kernel=default(kernel,0.5)
lambda=default(lambda,2000) # vector smooth
chroma=default(chroma,true) # use chroma
pel=default(pel,2) # pixel precision
thSCD1=default(thSCD1,300) # scenechange threshold
lsad=default(lsad,2000) # lambda SAD limit
pnew=default(pnew,50) # penalty new
add = (blksize>=8) ? blksize : 8
vecF = source.MVAnalyse(blksize=blksize, isb = false, lambda = lambda, chroma=chroma,  pel=pel, lsad=lsad, pnew=pnew,idx=101)
vecB = source.MVAnalyse(blksize=blksize, isb = true, lambda = lambda, chroma=chroma,  pel=pel, lsad=lsad, pnew=pnew,idx=101)
comp = source.mvflowfps(mvbw=vecB, mvfw=vecF, num=num, den=den, ml=ml, thscd1 = thscd1, idx=1)
shifted = source.addborders(blksize/2,blksize/2,add-blksize/2,add-blksize/2) # diagonal shift by half of block
vecFshifted = shifted.MVAnalyse(blksize=blksize, isb = false, lambda = lambda, chroma=chroma,  pel=pel, lsad=lsad, pnew=pnew,idx=102)
vecBshifted = shifted.MVAnalyse(blksize=blksize, isb = true, lambda = lambda, chroma=chroma,  pel=pel, lsad=lsad, pnew=pnew,idx=102)
compshifted = shifted.mvflowfps(mvbw=vecBshifted, mvfw=vecFshifted, num=num, den=den, ml=ml, thscd1 = thscd1, idx=102)
compshiftedback = compshifted.crop(blksize/2,blksize/2,blksize/2-add,blksize/2-add) # remove shifting borders
ov = BlockOverlap(comp,compshiftedback,xblksize=blksize, yblksize=blksize, kernel=kernel)
return ov
}

source=avisource("film.avi")
source.overlapFps(num=50, den=1)
It is not perfect too.
May be i will try to average not pixels, but its vectors in next MVTools versions.

P.S. Please, do not ask mg262, "did he ever try blockoverlap?"

Last edited by Fizick; 16th November 2005 at 20:41.
Fizick is offline   Reply With Quote
Old 17th November 2005, 13:27   #67  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Gent, Flanders, Belgium, Europe, Earth, Milky Way,Universe
Posts: 663
Quote:
Originally Posted by Fizick
videoFred,
thanks!
I am very interested in old 8mm film conversions too.
Me too... I do nothing else...
I do not even have a digital video cam, except my filmtransfer camera

Quote:
For example, you can change source fps from 16 to 16.66666 (=50/3) so way:
Yes, I understand... 18,75 must be possible, too.

I'm gonna try blockoverlap, too.
No, I'm not gonna ask mg262

But Depan after MVFlowFps works realy great!
Have you tried this? It's almost perfect!
I use the stand alone Depan for this..
Maybe it could be even faster with MVDepan?

I also noticed FFT denoising before MVFlowFps is not good.
Then MVFlowFps gives duplicate frames, why?

Soon I'm gonna post some MVFlowFps example clips on my website.

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest

Last edited by videoFred; 17th November 2005 at 13:30.
videoFred is offline   Reply With Quote
Old 17th November 2005, 21:24   #68  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
videoFred,
If MVtools duplicates frames, threafore it detect a scenechange. Try to increase thSCD1 parameter to about 500.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 18th November 2005, 07:53   #69  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Gent, Flanders, Belgium, Europe, Earth, Milky Way,Universe
Posts: 663
Fizick,

Thank you, I try this, too.

First tests on my HP pavillion (3ghz):
Original files progressive 1024x768 Hyffyuv.
script: Resizing-frame rate conversion-denoising-stabilising-cropping.

Script speed with old MVTools MVconvertFps: 1-2fps
Script speed with your MVFlowFps: 2-3fps

At play speeds from 15-16-18fps, converted to 25fps, almost no visible artefacts while playing on most files. Very smooth zooming and panning and general motion.

With some files even extreme slow motion is possible (1fps!!)
So Alpha version is already very useful for me.

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 20th November 2005, 23:49   #70  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
v.9.13 (Released 20.11.2005 )
Added truemotion preset to MVAnalyse.
Added experimental MVFlowFps2.
Change interpolated vector rounding method in all MVFLow... functions.
Edited documentation a little.

Probably i can put it to Avisynth usage MVtools topic now.
http://forum.doom9.org/showthread.php?t=84770
Al least i take a some its develipment pause in any case.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 21st November 2005, 09:54   #71  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,222
Unable to get 9.13 to run. I get the following error:

AVISynth open failure:
Evaluate: System exception - Access violation

The line on which this is reported is the line with MVFlowfps.

Here's the script:

Code:
loadplugin("c:\Program Files\AviSynth 2.5\plugins\kerneldeint140.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools.dll") 

AVISource("J:\Senior Video Tribute (do not erase)\Video\Video Highlights (JHM)\Baseball\Baseball-0013 - 000.avi")

assumebff()
changespeed(4, 1)

function changespeed(clip a, float factor, int th)
{

  ord = getparity(a) ? 1 : 0
  f=a.kerneldeint(order=ord, sharp=false, twoway=false, threshold=th) 
  e=a.separatefields.trim(1,0).weave.kerneldeint(order=1-ord, sharp=false, twoway=false, threshold=th)
  g=interleave(f,e).assumeframebased
  h=converttoyv12(g)


  vec_back = h.MVAnalyse(isb = true, lambda = 1000, lsad=1000, pnew=50, pel=2)
  vec_forw = h.MVAnalyse(isb = false, lambda = 1000, lsad=1000, pnew=50, pel=2)
  MVFlowFps(vec_back, vec_forw, num=30, den=1, ml=100, idx=1)
  converttoyuy2()
  assumefps(30,true)
  separatefields()
  (ord==0) ? selectevery(4,0,3) : selectevery(4,1,2)
  weave()
}
johnmeyer is online now   Reply With Quote
Old 21st November 2005, 10:38   #72  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Gent, Flanders, Belgium, Europe, Earth, Milky Way,Universe
Posts: 663
You forgat your source clip:
It must be: h.MVFlowFPS(etc...)
or: MVFlowFPS(h, etc...)

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 21st November 2005, 10:51   #73  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
Not really related, but still:

Instead of that "interleave-two-times-kerneldeint"-thingy, why not simply use LeakKernelBob() instead? Less script code, faster operation, same result ...
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 21st November 2005, 21:27   #74  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
johnmeyer,
I hope your problem now solved (thanks videoFred).

To all:
This thread is for programming questions only now.

For MVTools usage please post to other thread:
http://forum.doom9.org/showthread.php?t=84770
Fizick is offline   Reply With Quote
Old 22nd November 2005, 05:29   #75  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,222
Quote:
u forgat your source clip
-----------------
johnmeyer,
I hope your problem now solved (thanks videoFred).
-----------------------
Thanks videoFred. I was so excited, I started working on this as soon as I read about the new version -- way past my bedtime.

Yes, it works fine now.
johnmeyer is online now   Reply With Quote
Old 17th December 2005, 20:43   #76  |  Link
Neil Lee
Guest
 
Posts: n/a
Below is the example in MVTOOL1.0 Documentation:

======================================
To denoise with pel = 2, efficiently :

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


I was thinking instead of using (delta>1), why not just
add motion vectors between adjacent frames?
(Don't know how MVanalyse work internally, maybe this is it?)

Say I want MotionVector(Frame1,Frame4), I would rather
have a function to ADD motion vectors of adjacent frames.

MV14 = MV12 + MV23 + MV34

This way you won't ignore additional info you can get in Frame2,Frame3

Let's say you have a fast moving object, It's hard to find any
matching patterns between Frame1 and Frame4, it's out of search range.
But you'll have a better chance to find it in adjacent frames,
and then you just add them up ..)

Don't know if there's any precision issue for adding Motion Vectors,
How about use it as a secondary method for finding unmatched blocks?

.

Last edited by Neil Lee; 17th December 2005 at 21:12.
  Reply With Quote
Old 17th December 2005, 22:32   #77  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Neil Lee,
Thanks for interesting question.
Generally, there are many known ways to do motion estimation and compensation in special literature.
I am not Manao, who implemented it so way. But IMHO, current way:
1. Easy internally to implement.
2. Do not accumulate estimation error (mismatching). Not motion vector precision, but similarity (correspondense) of matched blocks by intensity (SAD).
3. Quite good vector MV13 can be found if some occlusion in frame 2 may prevent matching motion MV12 and MV23.

But I see advantage of your suggestion: It can results in more fast motion estimation when you use both delta=1 and delta>1 in complex scrips.
(we will estimate only delta=1 and have all deltas from it).
Fizick is offline   Reply With Quote
Old 17th December 2005, 23:32   #78  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,855
Don't be afraid of high motion. The motion estimation is done first on subsampled pictures, where even high motion in easy to catch.

Anyway, you can already try your idea if you want, with mvcompensate(mode=1) :
Code:
mvs1 = source.mvanalyse()                                          
mvs2 = source.mvanalyse(delta=2)
comp1 = source.mvcompensate(mvs1)
comp2 = comp1.mvcompensate(mvs1, mode = 1)
comp3 = source.mvcompensate(mvs2)                 
return interleave(source, comp1, comp2, comp3)
__________________
Manao is offline   Reply With Quote
Old 20th December 2005, 05:14   #79  |  Link
Isochroma
Registered User
 
Join Date: Mar 2005
Posts: 468
Thanks for all the work on your motion compensated denoiser! It performs very well indeed...

I am wondering about an inconsistency in the syntax of your mvdenoise example...

backward_vectors2 = source.MVAnalyse(isb = true, lambda = 1000, delta = 2)
backward_vectors1 = source.MVAnalyse(isb = true, lambda = 1000, delta = 1)
forward_vectors1 = source.MVAnalyse(isb = false, lambda = 1000, delta = 1)
forward_vectors2 = source.MVAnalyse(isb = false, lambda = 1000, delta = 2)
return source.MVDenoise(backward_vectors1, backward_vectors1, forward_vectors1, forward_vectors2, tht = 10, sadt = 300)

how are the parameters of mvdenoise arranged? backward_vectors1 is duplicated, while backward_vectors2 is not used? Your documentation does not provide enough syntax information for me to determine whether your example contains a mistake.

I'm interested in using the >2 frame denoise feature introduced in 0.9.9.1, but because I can't figure out the syntax, how would I write the script?

Also, clarification on the nature of the parameters, ie. clip, clip mvs [,...] ... is clip the current frame, and clip mvs a comma-delimited sequence of motion-vector variable names? Does their order matter?

Finally, the sadt argument causes an error stating that the function does not support it. I have installed the 0.9.9.1 version and am using the documentation from that version as written... any ideas?

Thanks!

Last edited by Isochroma; 20th December 2005 at 18:19.
Isochroma is offline   Reply With Quote
Old 20th December 2005, 06:20   #80  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
the docs are out of date for that one...

btw, i think the backward vectors 1 being used twice looks like a typo to me.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:02.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.