View Full Version : A script that needs debugging
superdump
18th September 2003, 13:16
I was struggling to make a Futurama source look good because the lines are just awful so I asked mf for a little help. He scripted the following but after encoding for a while I get access violations. The Mergechroma(blargh) line seems to be quite unstable ( as soon as it is used it sometimes causes unhandled exceptions when loading the script, always doesn't work properly, and always causes access violations after trying to encode/preview the first frame or any frame) and I've had a number of problems with the last LanczosResize(576,424) causing unhandled exceptions.
SetWorkingDir("C:\plugins\")
LoadPlugin("mpeg2dec3.dll")
LoadPlugin("unfilter.dll")
LoadPlugin("deen.dll")
Import("mftoondlls.avs")
Import("mftoon.avs")
mpeg2source("C:\DVD\Projects\S3E01\FUTURAMA_SEASON3_DISC1.d2v", cpu=6)
Crop(4, 4, -4, -4)
Unfilter(-50, -50)
LanczosResize(last.width*2, last.height)
blargh = last
mfToon(sharpen=false)
LanczosResize(last.width*4, last.height*4)
XSharpen(255, 255)
LanczosResize(blargh.width, blargh.height)
MergeChroma(blargh)
aWarpSharp(blurlevel=1)
LanczosResize(576,424)
deen("a3d",4,10,12,40)
mftoon is mf's latest (0.42) but we also tried 0.4 and i've been through and commented out all the functions and readded them one at a time to see what was causing the problems but could not find anything apart from what I stated above.
I tried encoding overnight with this script (yes, i know it's very slow but that's not my concern ;P) and after ~11000/32548 frames it died giving an access violation.
Thanks for your time. :)
EDIT: By the way I was using the last CVS build before the one released on the 17th September. As far as I can see no updates that will affect this script have been made. However I will test each function again and see what happens. :)
lamer_de
19th September 2003, 18:41
Well, my results won't help you much, but I get access violations aswell . I made the experience that mftoon reacts quite strange sometimes depending which filter are apllied before or after. Moving it to a different location helps sometimes.
May I ask what the purpose of the (to me) insane amount of Unfilter + the horizontal resoultion doubling before you apply mftoon?
Well, as I said, no much help, but at least confirms that there's a flaw in your/mftoon script :P
Funny enough, this works for me:
Import("C:\VDubMod\mfToon-v0_4.avs")
avisource("E:\Ultra_Manic_OVA.avi",false)
#Crop(4, 4, -4, -4)
Unfilter(-50, -50)
LanczosResize(640*2,480)
blargh = last
mfToon(sharpen=false)
LanczosResize(640*4, 480*4)
XSharpen(255, 255)
LanczosResize(640, 480)
MergeChroma(blargh)
aWarpSharp(blurlevel=1)
LanczosResize(576,424)
deen("a3d",4,10,12,40)
I have no clue why. The correct functioning seems to be random somehow. :mad:
CU,
lamer_de
mf
19th September 2003, 20:12
Originally posted by lamer_de
Well, my results won't help you much, but I get access violations aswell . I made the experience that mftoon reacts quite strange sometimes depending which filter are apllied before or after. Moving it to a different location helps sometimes.
May I ask what the purpose of the (to me) insane amount of Unfilter + the horizontal resoultion doubling before you apply mftoon?
Well, as I said, no much help, but at least confirms that there's a flaw in your/mftoon script :P
Funny enough, this works for me:
Import("C:\VDubMod\mfToon-v0_4.avs")
avisource("E:\Ultra_Manic_OVA.avi",false)
#Crop(4, 4, -4, -4)
Unfilter(-50, -50)
LanczosResize(640*2,480)
blargh = last
mfToon(sharpen=false)
LanczosResize(640*4, 480*4)
XSharpen(255, 255)
LanczosResize(640, 480)
MergeChroma(blargh)
aWarpSharp(blurlevel=1)
LanczosResize(576,424)
deen("a3d",4,10,12,40)
I have no clue why. The correct functioning seems to be random somehow. :mad:
CU,
lamer_de
I made the script :D. The things done are to get a very ugly futurama DVD to reasonable quality. It's oversharpened, thus unfilter, and it's sharper horizontally than vertically. So first I equal the horizontal/vertical sharpness, then apply sharpening, then downsize =). I know it's a bit strange, but hey, it's effective. And to say the least, most of my techniques are "unusual" :rolleyes:. Anyhow, there's also jagging around the lines, so I needed to warpsharp that out. That's kinda the explanation of the script :p.
Anyway, on to a more serious matter, I've noticed that the more complex version of mfToon you use, the more instable avisynth gets on interpreting it. I usually have to dodge the errors to get it working. This is getting more severe as I keep adding features and complexity to mfToon. I think someone may want to sit down with it and try a lot of combinations and debug them. Nice bughunt =). I'd be very glad with that anyway.
superdump
20th September 2003, 09:10
I had also tried hardcoding the resize resolutions but nothing of much use seemed to come of it. :)
MergeChroma() is definitely something that needs looking at though because it seems to merge the wrong chroma, some resized version maybe. but aside from that it makes the whole script even more unstable. The rest of the damage does, I'm afraid, seem to be caused by mftoon. :) I think someone should write an avisynth plugin with all the functionality of mftoon to possibly make it a bit more stable and a bit quicker. Maybe.
Anyway, I hope some avisynth developer feels interested enough to debug the above script sometime.
Thanks
Wilbert
22nd September 2003, 13:18
Try to replace Deen with another plugin to see if that's the problem.
superdump
22nd September 2003, 14:24
Wilbert: It isn't. I added deen just before I posted because I wanted that on the end. I had also commented out all functions (including deen) aside from the crop and the mpeg2source and worked my way down the list, uncommenting them until I got to one which made it break. Mergechroma gave an ugly picture (as if the chroma was a different resolution to the luma) and causes an error in the last lanczos resize. I will provide a screenshot if you wish. Thanks for looking at it. :) Any other ideas?
mf
22nd September 2003, 16:28
OhCand a sidenote: it does work on my system.
superdump
25th September 2003, 12:12
mfToon(sharpen=false)
LanczosResize(last.width*4, last.height*4)
XSharpen(255, 255)
LanczosResize(blargh.width, blargh.height)
MergeChroma(blargh)
I've found that if I remove those two lanczosresizes along with the mergechroma (because I've found it to be broken anyway) then I don't get any access violations but the lines become a bit too aliased again...
Maybe I don't have enough RAM or something...?
EDIT: Is there a resolution limit for the resize filters? Would there be a problem if I didn't have enough system ram for the script to use or would the page file suffice? :)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.