Log in

View Full Version : Crush after using LanczosResize


krieger2005
14th March 2004, 01:23
Hi,

i have a problem when i'm using LanczosResize. It crush after using it. I don't know why, fact is that i have a function, which do things for me. While the Function do this things for other Movies it crush at one special. I've looked were is the problem it the function: LanczosResize.

Here the Function:


global VDub = "F:\Software\Multimedia\Video-Editoren\Virtual Dub Fraktion\VirtualDubMod 1.5.4.1\plugins"


LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\KernelDeInt.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\DctFilter.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\STMedianFilter.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\UnDot.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\Convolution3DYV12.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\FluxSmooth.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\DeSpot.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\decomb511.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\RemoveDirt.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\MipSmooth.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\GuavaComb.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\GrapeSmoother.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\Deen.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\CNR2.dll")

LoadVirtualdubPlugin(VDub+"\2dcleanopt_k7.vdf", "_2DClean")
LoadVirtualdubPlugin(VDub+"\MEstimation.vdf","_Est")

SetMemoryMax(400)

function sauber(clip c){
x=RemoveDirt(c, mode=1, dist=3, tolerance=25, mthreshold=5)
y=RemoveDirt(c, mode=2, neighbour=x).UnDot()
z=RemoveDirt(x , mode=2, neighbour=y).UnDot()
x=RemoveDirt(z , mode=2, dist=0, tolerance=25)
return x
}


function all(string "name", int "cpu", int "trimVon", int "trimBis",
\ int "cropX1", int "cropY1", int "cropX2",
\ int "cropY2"){
clip=mpeg2source("D:\MOVIE\"+name, cpu2="xoxxox", iPP=true,
\ moderate_v=30, moderate_h=20).
\ ConvertToYV12().trim(trimVon,trimBis).
\ FieldDeinterlace(blend=false).
\ crop(cropX1,cropY1,cropX2,cropY2,align=true)
clip = clip.UnDot()
clip = clip.Convolution3d(1, 12, 30, 10, 10, 10, 0)
clip = clip.ConvertToYV12()
clip = clip.sauber()

norm=clip.FluxSmooth(7,6)
sc=Clip.Cnr2(mode="ooo",scdthr=70).FluxSmooth(13,13)
asc=clip.ConvertToRGB32()._2DClean(0,15,5,5).ConvertToYV12()
clip

a=ConditionalFilter(sc,norm,"UDifferenceFromPrevious()",">","2")
ConditionalFilter(asc,a,"VDifferenceFromPrevious()",">","9")

LanczosResize(712,520)
# BicubicResize(712,520,0,0.75)

Convolution3d("movieHQ")
return last
}



l=4

start = all("start.d2v", l, 1, 159, 16, 8, 688, 568)
seria01= all("seria01.d2v", l, 0, 69616, 16, 8, 688, 560)
ende01 = all("seria01E.d2v", l, 22, 180, 0, 0, 720, 576)

seria02= all("seria02.d2v", l, 20, 73477, 16, 8, -16, -8)
ende02 = all("seria02E.d2v", l, 25, 190, 0, 0, 720, 576)

seria031= all("seria03.d2v", l, 29, 72194, 16, 8, -16, -8)
seria032= all("seria03.d2v", l, 72195, 72838, 16,24, -16,-24)
ende03 = all("seria03E.d2v", l, 23, 223, 0, 0, 720, 576)

seria04= all("seria04.d2v", l, 20, 73460, 16, 8, -16, -8)
ende04 = all("seria04E.d2v", l, 24, 199, 0, 0, 720, 576)

seria05= all("seria05.d2v", l, 20, 73031, 16, 8, -16, -8)
ende05 = all("seria05E.d2v", l, 31, 201, 0, 0, 720, 576)


seria06= all("seria06.d2v", l, 9, 73526, 16, 8, -16, -8)
ende06 = all("seria06E.d2v", l, 13, 175, 0, 0, 720, 576)

seria07= all("seria07.d2v", l, 12, 73184, 16, 8, -16, -8)
ende07 = all("seria07E.d2v", l, 20, 195, 0, 0, 720, 576)

seria08= all("seria08.d2v", l, 20, 73331, 16, 8, -16, -8)
ende08 = all("seria08E.d2v", l, 22, 193, 0, 0, 720, 576)

seria09= all("seria09.d2v", l, 21, 68103, 16, 8, -16, -8)
ende09 = all("seria09E.d2v", l, 8, 173, 0, 0, 720, 576)

seria101= all("seria10.d2v", l, 5, 59824, 16, 8, -16, -8)
seria102= all("seria10.d2v", l, 59825, 60901, 16, 24, -40, -8)
seria103= all("seria10.d2v", l, 60902, 75317, 16, 8, -16, -8)
seria10 = seria101 + seria102 + seria103


film = start +
\ seria01 + ende01
\ + seria02 + ende02 +
\ seria031 + seria032 + ende03 +
\ seria04 + ende04 +
\ seria05 + ende05 +
\ seria06 + ende06 +
\ seria07 + ende07 +
\ seria08 + ende08 +
\ seria09 + ende09 +
\ seria10

return film


What's the Problem. Know someone the same situation? A solution?

sh0dan
14th March 2004, 01:30
AviSynth version?

Is this always reproducible, or does it happend at random?

Try without CNR2. It has been known to cause problems.

krieger2005
14th March 2004, 17:07
First: The Problem is Avisynth. It seems to bee a Memory-Problem because after i put this:

SetMemoryMax(400)

the Crahs gone. But here how i have tested...

I tried first with Avisynth 2.53. Then i've installed Avisynth 2.54. The crash was at different points (at 2.53 and 2.54) but kept.
I removed elements from the function to see where the problem was... When i remove CNR the crash happen. After i've removed LanczosResize there were no crash.

It seems, that LanczosResize need so many Memory, that Avisynth can't handle it... I think one can reproduce this Failure when using the function above to 20 movies as input which were concatenated after using this function. (hopefully someone undersand me ;))

Summurized: After "SetMemoryMax(400)" the crash is away but there is still a problem... but where (Avisynth? LanczosResize?)

Thanks for your Replies

Didée
14th March 2004, 17:49
Can't look into it that deeply now, but a few critical points:

Your "all" - function is quite complex !

- What does the "sauber()" function do? We don't see it, it could perhaps also cause problems.

- you build a chain with filters known to be somewhat critical (cnr2), or to have memory leaks (fluxsmooth). THEN you put that chain into some conditional statements(!). That is likely to produce problems.

So your script has several points where the trouble can arise from. It'd be required to disassemble it to very small pieces, and then fiddle out in very little steps when it starts to b0rk out ...

- Didée

sh0dan
15th March 2004, 11:10
Please post the _complete_ script. I cannot see how you use this function. "sauber()" is also missing.

lamer_de
15th March 2004, 11:11
Given this:
Summurized: After "SetMemoryMax(400)" the crash is away but there is still a problem...
and that: - you build a chain with filters known to be somewhat critical (cnr2), or to have memory leaks (fluxsmooth). THEN you put that chain into some conditional statements(!).
it's most likely that you craeted something that eats massive amounts of ram and therefore behaves unpredicable.
Following Didées suggestions is a good idea imho.

CU,
lamer_de

krieger2005
15th March 2004, 16:20
I updated my first post and put the hole script in.

Maybe the Problem is in
- FluxSmooth
- Cnr

I don't know. I only know, that when i set "LanczosResize" as comment ("#", and remove crop-option) the script make no problems. When i decomment "LanczosResize" there is a Avisynth-Failure...

The use of "BicubicResize(X,Y,b=0,c=0.5)" produce the same error (maybe with other b and c-values too).

PS: The Script use at the Moment 143MB Memory (in VirtualDub, seen with the Task-Mamanger). As i started the script yesterday VirtualDub used 374MB

-------------

Your "all" - function is quite complex !
Is there a way to do it simpler (I posted for that movie some time ago here (http://forum.doom9.org/showthread.php?s=&threadid=69805))
- RemoveDirt -> for Remove short bad-compressed scenes
- Cnr2 -> Remove Rainbow-Effect at Scenchange/Fast Moving Scenes
- _2DClean(0,15,5,5) -> Clean After Scene-change