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. |
27th September 2017, 03:50 | #1 | Link |
Registered User
Join Date: Mar 2014
Location: Hungary
Posts: 115
|
Plugin for cutting out a cross from the center
Hi!
I don't know if there is a request thread for plugins. What I would like is a plugin that cuts out a cross from the center of the footage so I can inspect the corners and edges whether they need crop and/or border fix without having to scroll the FullHD image. The current method that I use is this: Code:
a=FFMS2("D:\btn\something.mkv").Crop(0,0,-990,-710) b=FFMS2("D:\btn\something.mkv").Crop(990,0,-0,-710) c=FFMS2("D:\btn\something.mkv").Crop(0,710,-990,-0) d=FFMS2("D:\btn\something.mkv").Crop(990,710,-0,-0) e=StackHorizontal(a,b) f=StackHorizontal(c,d) StackVertical(e,f) I think it would be easy to make such plugin but I do not understand programming. It might be helpful for others also. Last edited by pcroland; 27th September 2017 at 20:31. |
27th September 2017, 06:03 | #2 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Hope this will do.
Corners.avsi (for Plugins dir) Code:
# Corners.avsi, http://forum.doom9.org/showthread.ph...81#post1819881 # Crops all 4 corners of input and outputs stack4 window clip of those corners, allows viewing of corners without scrolling large input clip. # Giving W=Width(default width/4) and H=Height(default Height/4) of corners. (Default output dim half of input dim, ie 2*Width/4, 2*Height/4). # (Max W=c.Width, H=c.Height, where output 4 window stack of double dimensions to input). Function Corners(clip c, Int "W", Int "H") { c W = Default(W,Width/4) H = Default(H,Height/4) # Default corners quarter of dimensions W=W/4*4 H=H/4*4 # W Mod4 (YV411 compat), H Mod4 (YV12 Interlaced compat) Assert(0 < W <= Width , "Corners: Invalid W"+String(W,"(%.0f)")) Assert(0 < H <= Height, "Corners: Invalid H"+String(H,"(%.0f)")) tl=crop(0,0,W,H) tr=crop(Width-W,0,W,H) bl=crop(0,Height-H,W,H) br=crop(Width-W,Height-H,W,H) Top=StackHorizontal(tl,tr) bot=StackHorizontal(bl,br) Return StackVertical(Top,Bot) } # Alternate function, Giving W=Width and H=Height of output clip (should be W=Mod8 for YV411 and H=Mod8 for Interlaced YV12) # (Max W=c.Width*2, H=c.Height*2, where output 4 window stack of double dimensions to input). Function Corners2(clip c, Int "W", Int "H") { return c.Corners( Default(W,c.Width/2)/8*4, Default(H,c.Height/2)/8*4) } # Return stack4 window, double dim of input clip. (Maybe of use if some plugin metrics are too big for the input clip [some metrics missing]) Function CornersX4(clip c) { return c.Corners(c.Width,c.Height) } Code:
# FFMS2("D:\btn\something.mkv") Colorbars.KillAudio # My Test #Corners() # Output = half input dim #Corners(Width/4,Height/4) # Output = half input dim #Corners(Width,Height) # Output = double input dim (stack4 window, maybe if frame metrics too big for small input clip). #Corners2() # Output = half input dim #Corners2(Width/2,Height/2) # Output = half input dim #Corners2(Width*2,Height*2) # Output = double input dim (stack4 window, maybe if frame metrics too big for small input clip). Corners2(480,360) # Output = specific size #CornersX4 # Output = double input dim (stack4 window, maybe if frame metrics too big for small input clip). Info Return Last EDIT: Relaxed max W,H, limited at output dim to twice input dim. (may be of use to some) EDIT: Added DoubleDim(). EDIT: Renamed DoubleDim() to CornersX4().
__________________
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; 27th September 2017 at 15:31. Reason: Minor mods |
Tags |
avisynth, borders, crop, stackhorizontal, stackvertical |
|
|