View Single Post
Old 28th October 2018, 17:37   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
These are the important ones, but dependent upon your clip/subs.

Code:
# Subtitle coords
X        = 180
Y        = Height-140
W        = -X
H        = -44
# Text, Halo color
TEXTCOL   = $FDFDFD
TEXTVAR   = 2                             # Text RGB channels can vary by as much as TEXTVAR, eg $FEFEFE with TEXTVAR=1 ranges $FDFDFD -> $FFFFFF
HALOCOL   = $020202
HALOVAR   = 2                             # Halo RGB channels can vary by as much as HALOVAR, eg $FEFEFE with HALOVAR=1 ranges $FDFDFD -> $FFFFFF
# Text pixel width,height
TEXT_W    = 4                             # minimum text pixel 'thickness' Horizontal (horizontal thickness of vertical strokes)
TEXT_H    = 4                             # minimum text pixel 'thickness' Vertical (vertical thickness of horizontal strokes)
# Halo pixel width,height
HALO_L    = 5                             # Left Halo width in pixels
HALO_R    = 5                             # Right Halo width in pixels
HALO_T    = 5                             # Top Halo height in pixels
HALO_B    = 5                             # Bot Halo height in pixels
# Mt_Hysteresis (reduce stray pixels):- http://forum.doom9.org/showthread.php?p=1780589#post1780589
THYSCNT   = 5                             # Text Mask Mt_Hysteresis inpand count (prior to mt_hysteresis), Dont Mt_Hysteresis if 0
HHYSCNT   = 5                             # Halo Mask Mt_Hysteresis inpand count (prior to mt_hysteresis), Dont Mt_Hysteresis if 0
DHYSCNT   = 5                             # Detect clip Mt_Hysteresis inpand count (prior to mt_hysteresis), Dont Mt_Hysteresis if 0
These can (mostly) default based on above.
Code:
THRESH_W  = -(Text_w+(Halo_L+Halo_R)/2)   # -ve, specifies Abs(Pixel width)  {Else +ve = Percent width 0.0->100.0%) {0.0=any pixel in range)
THRESH_H  = -(Text_h+(Halo_T+Halo_B)/2)   # -ve, specifies Abs(Pixel Height) {Else +ve = Percent width 0.0->100.0%) {0.0=any pixel in range)
#
BAFFLE_W  = Text_w+Halo_L+Halo_R-2        # Width of outermost Vertical edges.
BAFFLE_H  = Text_h+Halo_T+Halo_B          # Height of outermost Horizontal edges.
Will likely not work on XP (with current masktools) due to no support for mt_Polish(InFix), in current masktools2.

Might be an amount of playing with settings to get it to work.

EDIT:
Quote:
Sometimes it picks up white parts other than the subtitles.
Thats what the below swelling stuff overcomes (and why it needs halo).
Quote:
Finds halo color and swells all instances several pixels, does the same with the text color,
where both swellings overlap (halo swells into text, and text swells into halo), then you have detected subtitle
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 28th October 2018 at 17:43.
StainlessS is offline   Reply With Quote