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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th August 2015, 06:11   #1  |  Link
TheVillageIdiot
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)
}
I'm on Avisynth 2.60, How do I fix this? Please help!

*Apologies if this is the incorrect section*

Last edited by TheVillageIdiot; 13th August 2015 at 06:19.
TheVillageIdiot is offline   Reply With Quote
Old 13th August 2015, 07:30   #2  |  Link
Desbreko
Registered User
 
Desbreko's Avatar
 
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.
__________________
Twitter, AviSynth scripts
Desbreko is offline   Reply With Quote
Old 13th August 2015, 07:43   #3  |  Link
TheVillageIdiot
Registered User
 
Join Date: Jul 2015
Posts: 9
Quote:
Originally Posted by Desbreko View Post
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.
That did it, thank you lots!
TheVillageIdiot is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.