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 27th September 2017, 03:50   #1  |  Link
pcroland
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)
Picture of this script working

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.
pcroland is offline   Reply With Quote
Old 27th September 2017, 06:03   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
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) }
Client script
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: Added Corners2() Function, can choose whatever one you like.
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
StainlessS is offline   Reply With Quote
Old 27th September 2017, 07:24   #3  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
This is rule 6 violation
lansing is offline   Reply With Quote
Old 27th September 2017, 15:17   #4  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 115
Quote:
Originally Posted by StainlessS View Post
Hope this will do.
Wow :O Amazing work, thank you very much

Quote:
Originally Posted by lansing View Post
This is rule 6 violation
Removed the filenames in the OP if that matters...
pcroland is offline   Reply With Quote
Reply

Tags
avisynth, borders, crop, stackhorizontal, stackvertical

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 19:59.


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