Log in

View Full Version : Cannot finish an intermediary encode, Avisynth read error


Chainmax
3rd January 2012, 23:30
I am trying to make an intermediate lossless encode to be fed into an x264 CLI. Problem is, somewhere around 10% completion I get this error:

Avisynth read error:
Avisynth: unknown exception

The filterchain is as follows:

MPEG2Source("X:\wherever\mydgindex.d2v")

Interp = nnedi3()
Deinted=TDeint(type=1,edeint=Interp,emask=TMM())
TFM(d2v="X:\wherever\mydgindex.d2v",mode=6,PP=7,slow=2,mChroma=true,Clip2=Deinted)
vinverse()
TDecimate(mode=1)

RemoveGrain(mode=5)

source=last
preNR=source.RemoveGrain(mode=5).FFT3DFilter(sigma=3,plane=3,bw=32,bh=32,bt=3,ow=16,oh=16)
preNR_super=preNR.MSuper(pel=2, sharp=1)
source_super=source.MSuper(pel=2, sharp=1)
backward_vec3 = MAnalyse(preNR_super,isb = true, delta = 3, overlap=4)
backward_vec2 = MAnalyse(preNR_super,isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(preNR_super,isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(preNR_super,isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(preNR_super,isb = false, delta = 2, overlap=4)
forward_vec3 = MAnalyse(preNR_super,isb = false, delta = 3, overlap=4)
source.MDegrain3(source_super,backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=350)

Crop(6,0,712,476,align=true)
Spline36Resize(704,480)

aWarpSharp2(depth=16,chroma=4)

dull=last
sharp=last.LimitedSharpenFaster(SMode=4,Strength=150)
Soothe(sharp,dull,25)

GradFunkMirror(1.51)

The Avisynth version I'm using is the Sept 13, 2011 v2.60 one, and the lossless codec is Lagarith v1.3.20 in its YV12 mode. If this is not enough data to troubleshot the issue, please let me know.


P.S: as an aside, do ~4-~5fps sound ok for this encode if done on a Core i5 2410M? I thought about using SetMTMode as I did a long time ago, but decided otherwise as I was not really seeing any increase in encoding speed.

vampiredom
3rd January 2012, 23:47
Try SetMemoryMax(1024) or higher, possibly.

Chainmax
4th January 2012, 01:59
SetMemoryMax is set at 2048 actually (half the system's RAM). Forgot to include it, my bad.

Didée
4th January 2012, 03:19
Halve that, and try again.

Chainmax
4th January 2012, 16:52
Huh, seems to be working alright now: it's currently close to 43%. What's the rationale behind it? Also, can anyone answer my second question, the one regarding my current encoding speed?

Didée
4th January 2012, 19:01
On 32bit windows there is a 2GB-per-process limit, I bet you've heard of that. SetMemoryMax declares how big the frame cache of Avisynth may grow. If you allow the frame cache to grow&grab the full 2GB, where should Avisynth core, host application, and encoder take place? Out of memory ...

For SetMemoryMax, the rule-of-thumb is: "The smaller, the better." (As long as you don't fall below a script-specific minimum.)

Chainmax
5th January 2012, 03:50
That would be a fine explanation if I had a 32bit OS, but I don't...

kypec
5th January 2012, 06:11
That would be a fine explanation if I had a 32bit OS, but I don't...
Are you using 64-bit Avisynth? If not then Didee's reasoning still applies to 32-bit Avisynth in the same way as it applies to all 32-bit apps, no matter whether they run under 32-bit or 64-bit OS.

TheRyuu
5th January 2012, 07:07
If your application that you're using to access avisynth with is compiled with large address awareness then it can access 4GB of RAM with a 64-bit operation system (32-bit avisynth that is).

You can check for the large address awareness flag with dumpbin (and add/change it with editbin).