PDA

View Full Version : Avisynth or AvsP ntdll.dll crash with MT


Graigddu
30th August 2008, 22:51
I have been trying to run an avisynth script with MT and find if i use SetModeMT the script encodes with HCEnc in The FilmMachine fine although quite slower than with MT but if i use MT in the script i get this error in virtualdub and even viewing through an other external player in AvsP will cause an error or player crash

An out-of-bounds memory access (access violation) occurred in module 'ntdll'...
...reading address 0000043D.

the error can appear with any external player i use with AvsP as i also received an error concerning ntdll.dll with media player 6.4 sometimes i get an error sometimes it just crashes, also when encoding with HCenc

The only way i can use MT is by only having it in the script

1st Script that crashes
SetMTmode(mode=5,threads=2)
SetMemoryMax(256)
# 16:9 encoding
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MT Filter\MT.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools-v1.5.8\MaskTools.dll") #version 1.58
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Masktools 2.0a21\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrain\RemoveGrain.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Warpsharp\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DNR2\Dnr2_for_25.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FluxSmooth\FluxSmooth.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\Functions\funkydeblock.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\Functions\LimitedSharpenFaster.avs")
DirectShowSource("C:\Video\Editing\Test Copy.avi", fps=23.976, audio=false, convertfps=true)
SetMTmode(mode=2,threads=2)
ConvertToYV12()
FadeIn(50)
Lanczos4Resize(720,436,0.0,0.6)
AddBorders(0,70,0,70)
AssumeFPS(25,1,False)
SetMTmode(mode=5,threads=2)
MT("""
funkydeblock(th=5)
DNR2(8,4,6,3,6,3,"dnr2")
FluxSmoothST(7,7)
LimitedSharpenFaster(strength=100)
""", 2)

MT working Script
SetMemoryMax(256)
# 16:9 encoding
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MT Filter\MT.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools-v1.5.8\MaskTools.dll") #version 1.58
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Masktools 2.0a21\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrain\RemoveGrain.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Warpsharp\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ColorMatrix\ColorMatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DNR2\Dnr2_for_25.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FluxSmooth\FluxSmooth.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\Functions\funkydeblock.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\Functions\LimitedSharpenFaster.avs")
DirectShowSource("C:\Video\Editing\Test Copy.avi", fps=23.976, audio=false, convertfps=true)
ConvertToYV12()
ColorMatrix()
FadeIn(50)
Lanczos4Resize(720,436,0.0,0.6)
AddBorders(0,70,0,70)
AssumeFPS(25,1,False)
MT("""
funkydeblock(th=5)
DNR2(8,4,6,3,6,3,"dnr2")
FluxSmoothST(7,7)
LimitedSharpenFaster(strength=100)
""", 2)


If anyone can suggest where i'm going wrong or how i could speed up using the filters i would be eternally grateful as i have been playing with this deblocking script for quite a while.

I have searched for possible fixes for various ntdll.dll crashes with google but none iv'e tried worked.:(

thetoof
30th August 2008, 22:53
1 - I think you have to use either setmtmode or mt, not both
2 - Maybe 256 is not enough memory for your script

Graigddu
30th August 2008, 23:14
thanks for the reply thetoof :)

i tried increasing SetMemoryMax(256) up to a max of 1024 as i have 2GB of ram but still crashed so it seems likely that your other answer of either SetModeMT or MT is the problem,

Would i be able to run all the script under MT and what would that entail.

Adub
30th August 2008, 23:23
First try running it under SetMTmode. I usually use this mode when multithreading whole scripts. When I only want to multithread portions of the script, then thats when I use MT.

Graigddu
30th August 2008, 23:32
I have to be honest i find that SetModeMT is some way slower than MT i think from what iv'e observed even MT with the denoising filters only seems quicker than SetModeMT for the whole script,
that is if i'm not making a mistake somewhere which is highly likely,

seems that i'll have to put up with the extra time taken :)

:thanks: for the help

Edit:Iv'e just tried to run the partial MT script in HCEnc and even that is crashing after around 1 min so seems that i'll only be able to use SetMTmode

Adub
30th August 2008, 23:50
Is your system overclocked at all? It's odd that a simple MT script will crash.

Although, I suppose it is possible that the filters you are using don't like the way MT threads things.

Graigddu
31st August 2008, 00:01
No overclocking think it's as you mentioned that the filters are causing a conflict somewhere

Adub
31st August 2008, 00:06
Hmm. If I have time in the next few days, I try and test if those filters crash on my system as well using the MT("....") portion. PM me if I forget.

Graigddu
31st August 2008, 00:10
Thanks much appreciated :)

Sagekilla
31st August 2008, 15:16
It sounds like it's because you're using SetMTMode() and MT(). I don't think it's threadsafe to use both. You could also be running into issues of filters that don't work properly with the split frame threading of MT()

Graigddu
31st August 2008, 16:43
I think it's the filter issue as i tried running only MT on the
funkydeblock(th=5)
DNR2(8,4,6,3,6,3,"dnr2")
FluxSmoothST(7,7)
LimitedSharpenFaster(strength=100)
and HCenc still falls over around a minute into the encode which is a shame really as Mt
seems to remove an hour+ from SetMTMode's time per pass on a 2 pass encode
I think that removing a filter at a time will be my next option just to see if it's a specific filter or script

Graigddu
31st August 2008, 20:48
I did as i mentioned and removed a filter or script at a time starting with LimitedSharpenFaster and from
preliminary testing this was causing the error and crash as both AvsP and HCEnc have worked fine after removing the
script and the filters needed for LimitedSharpenFaster.
Is there any other sharpening filter that someone can recommend instead

Also as a mention i tried running a script with both SetMTMode and MT in it but with LimitedSharpenFaster removed and
it seemed to work fine,having MT for the noise filter dropped a 1st pass from 3+hours to around 1Hr 15 mins a big reduction

will have a play around tomorrow and report if anything changes