Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
13th August 2015, 06:11 | #1 | Link |
Registered User
Join Date: Jul 2015
Posts: 9
|
Getting error with BalanceBorders()
Hi,
I am trying to use BalanceBorders to fix some dirty lines, but I get this cache error after loading it -> http://i1.someimage.com/D0klYUG.png Script - import("C:\Program Files (x86)\AviSynth 2.5\plugins\BalanceBorders.avs") FFVideoSource("G:\test.mkv") BalanceBorders(2,0,0,0,thresh=28) BalanceBorders.avs is as under : Code:
function BalanceBorders(clip c, int cTop, int cBottom, int cLeft, int cRight, int "thresh", int "blur") { Assert(isYV12(c), "This is not an YV12 clip. Convert color space to YV12 before using BalanceBorders().") thresh = Default(thresh, 128) blur = Default(blur, 999) Assert(blur > 0, "Blur parameter in BalanceBorders() must be > 0") Assert(thresh > 0, "Thresh parameter in BalanceBorders() must be > 0") c cTop >0 ? BalanceTopBorder(cTop, thresh, blur).TurnRight() : last.TurnRight() cLeft >0 ? BalanceTopBorder(cLeft, thresh, blur).TurnRight() : last.TurnRight() cBottom >0 ? BalanceTopBorder(cBottom, thresh, blur).TurnRight() : last.TurnRight() cRight >0 ? BalanceTopBorder(cRight, thresh, blur).TurnRight() : last.TurnRight() } function BalanceTopBorder(clip c, int cTop, int "thresh", int "blur") { cWidth = c.width cHeight = c.height cTop = min(cTop,cHeight-1) blurWidth = max(4,floor(cWidth/blur)) c2 = c.PointResize(cWidth*2,cHeight*2) c2.\ Crop(0,cTop*2,cWidth*2,2) PointResize(cWidth*2,cTop*2) BilinearResize(blurWidth*2,cTop*2) mt_convolution("1 1 1","0 1 0",y=3,u=3,v=3) BilinearResize(cWidth*2,cTop*2) referenceBlur = last original = c2.Crop(0,0,cWidth*2,cTop*2) original BilinearResize(blurWidth*2,cTop*2) mt_convolution("1 1 1","0 1 0",y=3,u=3,v=3) BilinearResize(cWidth*2,cTop*2) originalBlur = last balanced = mt_lutXYZ(original,originalBlur,referenceBlur,"z y - x +",y=3,u=3,v=3) difference = mt_makeDiff(balanced,original,y=3,u=3,v=3) tp = string(128+thresh) tm = string(128-thresh) difference = difference.mt_lut("x "+tp+" > "+tp+" x ?",y=3,u=3,v=3) difference = difference.mt_lut("x "+tm+" < "+tm+" x ?",y=3,u=3,v=3) mt_addDiff(original,difference,y=3,u=3,v=3) StackVertical(last,c2.Crop(0,cTop*2,cWidth*2,(cHeight-cTop)*2)).PointResize(cWidth,cHeight) } *Apologies if this is the incorrect section* Last edited by TheVillageIdiot; 13th August 2015 at 06:19. |
13th August 2015, 07:30 | #2 | Link |
Registered User
Join Date: Feb 2015
Posts: 55
|
You might have an outdated version of MaskTools2. Try getting the b1 version, and make sure there are no other masktools dlls in your autoload folder.
|
13th August 2015, 07:43 | #3 | Link | |
Registered User
Join Date: Jul 2015
Posts: 9
|
Quote:
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|