hunter_aran
12th December 2011, 21:43
I am still rather new at using Avisynth/Megui and wanted to know if anyone has any ideas why it's crashing for me. The crash happens as x264 increases it's RAM usage sharply and shortly before it maxes out the 2GB that my virtual machine uses, it crashes, usually with error code -1073741819. In this case it's not intermittent and happens every time, usually within 5 minutes of the first pass. Funny thing is that several other scripts with the same source and very minor differences run so it's something I wrote in that's causes the memory leak.
Here's the problem script:
SetMemorymax(512)
SetMTMode(mode=2, threads=0)
Import("C:\Program Files\AviSynth 2.5\plugins\aaa.avs")
DGDecode_MPEG2Source("\\psf\home\desktop\D2V Project Files\Spongebob S2 D2V\Spongebob_2_Your_Shoes_Untied.d2v")
global MeGUI_darx = 120
global MeGUI_dary = 91
AnimeIVTC(mode=1)
srestore(omode=4)
crop(4, 0, -4, 0)
DeHalo_alpha(rx=1.5, ry=1.5, darkstr=1.5, brightstr=1.5, lowsens=80, highsens=20)
vmtoon(sharpen=false, thinning=0, strength=50)
aaa()
Here's the one that works fine:
SetMemorymax(512)
SetMTMode(mode=2, threads=0)
Import("C:\Program Files\AviSynth 2.5\plugins\aaa.avs")
DGDecode_MPEG2Source("\\psf\home\desktop\D2V Project Files\Spongebob S2 D2V\Spongebob_2_Your_Shoes_Untied.d2v")
global MeGUI_darx = 4
global MeGUI_dary = 3
AnimeIVTC(mode=1)
srestore(omode=4)
crop(4, 0, -4, -2)
DeHalo_alpha(rx=1.5, ry=1.5, darkstr=1.5, brightstr=1.5, lowsens=80, highsens=20)
vmtoon(sharpen=false, thinning=0, strength=50)
aaa()
The only thing I changed is adding the crop on the bottom of
-2 and adjusting the encoded AR to what Megui's "clever anamorphic" to 4:3. That part is a little strange to me given that the "clever anamorphic" is saying 4:3 when I was under the impression that any cropping will change the AR to preserve the proportion.
Any ideas why the cropping/AR change might be causing this memory leak in x264? Thanks a lot!
Edit: Actually I tested the second script all the way through and it crashed too. If I change the crop, AR, AND use the default for srestore (not omode=4) it works fine so maybe that's the culprit. But srestore(omode=4) after AnimeIVTC(mode=1) was the only way I've found to get rid of the blend telecined footage. Mode=2 on AnimeIVTC did not get rid of them and default srestore does another round of decimation which I do not need. I'll try using srestore by itself and see what happens I guess...
Edit2: Well it's still not working so I guess at this point it's a problem with srestore. AnimeIVTC does use srestore but I only got that warning about not calling srestore twice when I use it in conjuction with AnimeIVTC(mode=2), not mode=1. I also tried running srestore under SetMtMode=5 but no cigar. I'm kinda at a loss of what to do other than toss out srestore all together but it's a shame considering it worked so well when previewed in VDub.
Edit3: Well the scripts with srestore and the 4,0,-4,0 cropping started to work after starting them enough times (?) so it was not srestore after all, howevere the result, when seen in real time, was too noticeably choppy. So I messed around with it more and figured out that if I put the cropping at the end of the script, the memory leaks go away! I read that cropping right after IVTC, you will use less time encoding because you cut off all those black pixels out before further filtering but I guess it screws it all up somehow. Anyway, at least if someone has some similar problem, it might be just a case of changing the order of your filters.
Here's the problem script:
SetMemorymax(512)
SetMTMode(mode=2, threads=0)
Import("C:\Program Files\AviSynth 2.5\plugins\aaa.avs")
DGDecode_MPEG2Source("\\psf\home\desktop\D2V Project Files\Spongebob S2 D2V\Spongebob_2_Your_Shoes_Untied.d2v")
global MeGUI_darx = 120
global MeGUI_dary = 91
AnimeIVTC(mode=1)
srestore(omode=4)
crop(4, 0, -4, 0)
DeHalo_alpha(rx=1.5, ry=1.5, darkstr=1.5, brightstr=1.5, lowsens=80, highsens=20)
vmtoon(sharpen=false, thinning=0, strength=50)
aaa()
Here's the one that works fine:
SetMemorymax(512)
SetMTMode(mode=2, threads=0)
Import("C:\Program Files\AviSynth 2.5\plugins\aaa.avs")
DGDecode_MPEG2Source("\\psf\home\desktop\D2V Project Files\Spongebob S2 D2V\Spongebob_2_Your_Shoes_Untied.d2v")
global MeGUI_darx = 4
global MeGUI_dary = 3
AnimeIVTC(mode=1)
srestore(omode=4)
crop(4, 0, -4, -2)
DeHalo_alpha(rx=1.5, ry=1.5, darkstr=1.5, brightstr=1.5, lowsens=80, highsens=20)
vmtoon(sharpen=false, thinning=0, strength=50)
aaa()
The only thing I changed is adding the crop on the bottom of
-2 and adjusting the encoded AR to what Megui's "clever anamorphic" to 4:3. That part is a little strange to me given that the "clever anamorphic" is saying 4:3 when I was under the impression that any cropping will change the AR to preserve the proportion.
Any ideas why the cropping/AR change might be causing this memory leak in x264? Thanks a lot!
Edit: Actually I tested the second script all the way through and it crashed too. If I change the crop, AR, AND use the default for srestore (not omode=4) it works fine so maybe that's the culprit. But srestore(omode=4) after AnimeIVTC(mode=1) was the only way I've found to get rid of the blend telecined footage. Mode=2 on AnimeIVTC did not get rid of them and default srestore does another round of decimation which I do not need. I'll try using srestore by itself and see what happens I guess...
Edit2: Well it's still not working so I guess at this point it's a problem with srestore. AnimeIVTC does use srestore but I only got that warning about not calling srestore twice when I use it in conjuction with AnimeIVTC(mode=2), not mode=1. I also tried running srestore under SetMtMode=5 but no cigar. I'm kinda at a loss of what to do other than toss out srestore all together but it's a shame considering it worked so well when previewed in VDub.
Edit3: Well the scripts with srestore and the 4,0,-4,0 cropping started to work after starting them enough times (?) so it was not srestore after all, howevere the result, when seen in real time, was too noticeably choppy. So I messed around with it more and figured out that if I put the cropping at the end of the script, the memory leaks go away! I read that cropping right after IVTC, you will use less time encoding because you cut off all those black pixels out before further filtering but I guess it screws it all up somehow. Anyway, at least if someone has some similar problem, it might be just a case of changing the order of your filters.