Maybe of interest: QueryborderCrop(), Requires RT_Stats v1.03 plug & GScript for Avisynth.
http://forum.doom9.org/showthread.ph...57#post1586857
And examples using it:
http://forum.doom9.org/showthread.ph...60#post1586860
http://forum.doom9.org/showthread.ph...22#post1589022
EDIT: Or this modified script:
Code:
GSCript("""
RELATIVE= true # True show width as eg -8, False as eg 640
DEBUG = True # Show output in DebugView
OUTFILE = "CROP.TXT" # Crop log
VideoFileName =LCase("D:\TEST_VOBS\PAL-P_169_P\ReturnOfTheKing_Extended.d2v")
MPEG2Source(VideoFileName,cpu2="xxxxxx")
QBC=QueryBorderCrop(Relative=RELATIVE,Debug=DEBUG) # Get Return string and initialize QBCropX type variables in Avisynth
Eval(QBC) # Set crop variables
#Spline36Resize(640,480,QBCropX,QBCropY,QBCropW,QBCropH) # Crop Exact, DO NOT USE IN CROP, OK in Resize
#Crop(QBCropXL,QBCropYL,QBCropWL,QBCropHL) # CropLess
Crop(QBCropXM,QBCropYM,QBCropWM,QBCropHM) # CropMore
#Crop(QBCropXP,QBCropYP,QBCropWP,QBCropHP) # CropPlus
A = RT_TxtGetLine(QBC,0) # Exact
B = RT_TxtGetLine(QBC,1) # CropLess
C = RT_TxtGetLine(QBC,2) # CropMore
D = RT_TxtGetLine(QBC,3) # CropPlus
Subtitle(A,y=0)
Subtitle(B,y=20)
Subtitle(C,y=40)
Subtitle(D,y=60)
RT_TxtWriteFile(QBC,OUTFILE) # write log file
return last
""")
With results in Debugview:
Code:
00000004 15:35:38 RT_Debug: QBC:
00000005 15:35:38 RT_Debug: QBC: QueryBorderCrop v1.08 - 29 Aug 2012 - By StainlessS
00000006 15:35:38 RT_Debug: QBC:
00000007 15:35:38 RT_Debug: QBC: Samples=24 Thresh=-32.00 Laced=true Matrix=2
00000008 15:35:38 RT_Debug: QBC: XMod=2 YMod=4 WMod=4 HMod=4
00000009 15:35:38 RT_Debug: QBC: Relative=true Prefix=QBCrop RLBT=15 Ignore=0.20
00000010 15:35:38 RT_Debug: QBC:
00000011 15:35:38 RT_Debug: QBC: AutoThresh Using Avisynth Planar Luma Sampling
00000012 15:35:39 RT_Debug: QBC: AutoThresh 1 ) [715 ] YPlaneMin=16
00000013 15:35:39 RT_Debug: QBC: AutoThresh 2 ) [1430 ] YPlaneMin=16
00000014 15:35:39 RT_Debug: QBC: AutoThresh 3 ) [2145 ] YPlaneMin=16
00000015 15:35:39 RT_Debug: QBC: AutoThresh 4 ) [2860 ] YPlaneMin=16
00000016 15:35:40 RT_Debug: QBC: AutoThresh 5 ) [3575 ] YPlaneMin=16
00000017 15:35:40 RT_Debug: QBC: AutoThresh 6 ) [4290 ] YPlaneMin=16
00000018 15:35:40 RT_Debug: QBC: AutoThresh 7 ) [5004 ] YPlaneMin=16
00000019 15:35:40 RT_Debug: QBC: AutoThresh 8 ) [5719 ] YPlaneMin=16
00000020 15:35:41 RT_Debug: QBC: AutoThresh 9 ) [6434 ] YPlaneMin=16
00000021 15:35:41 RT_Debug: QBC: AutoThresh 10) [7149 ] YPlaneMin=16
00000022 15:35:41 RT_Debug: QBC: AutoThresh 11) [7864 ] YPlaneMin=16
00000023 15:35:41 RT_Debug: QBC: AutoThresh 12) [8579 ] YPlaneMin=16
00000024 15:35:42 RT_Debug: QBC: AutoThresh 13) [9294 ] YPlaneMin=16
00000025 15:35:42 RT_Debug: QBC: AutoThresh 14) [10009] YPlaneMin=16
00000026 15:35:42 RT_Debug: QBC: AutoThresh 15) [10724] YPlaneMin=16
00000027 15:35:42 RT_Debug: QBC: AutoThresh 16) [11439] YPlaneMin=16
00000028 15:35:42 RT_Debug: QBC: AutoThresh 17) [12154] YPlaneMin=16
00000029 15:35:43 RT_Debug: QBC: AutoThresh 18) [12869] YPlaneMin=16
00000030 15:35:43 RT_Debug: QBC: AutoThresh 19) [13583] YPlaneMin=16
00000031 15:35:43 RT_Debug: QBC: AutoThresh 20) [14298] YPlaneMin=16
00000032 15:35:43 RT_Debug: QBC: AutoThresh 21) [15013] YPlaneMin=16
00000033 15:35:44 RT_Debug: QBC: AutoThresh 22) [15728] YPlaneMin=16
00000034 15:35:44 RT_Debug: QBC: AutoThresh 23) [16443] YPlaneMin=16
00000035 15:35:44 RT_Debug: QBC: AutoThresh 24) [17158] YPlaneMin=16
00000036 15:35:44 RT_Debug: QBC: AutoThresh Thresh=48.00
00000037 15:35:44 RT_Debug: QBC:
00000038 15:35:48 RT_Debug: QBC: Top 2) [1430 ] AveY=65.15 CY=75
00000039 15:35:48 RT_Debug: QBC: Bot 2) [1430 ] AveY=61.18 CH=-76
00000040 15:35:48 RT_Debug: QBC: Lft 2) [1430 ] AveY=48.26 CX=46
00000041 15:35:49 RT_Debug: QBC: Rgt 2) [1430 ] AveY=48.14 CW=-77
00000042 15:35:49 RT_Debug: QBC: Lft 3) [2145 ] AveY=120.76 CX=0
00000043 15:35:49 RT_Debug: QBC: Rgt 3) [2145 ] AveY=106.21 CW=0
00000044 15:36:02 RT_Debug: QBC: Active Frames (where image coords first found) = 2
00000045 15:36:02 RT_Debug: QBC: Sampled Borders: X=0 Y=75 W=0(720) H=-76(425)
00000046 15:36:02 RT_Debug: QBC:
00000047 15:36:02 RT_Debug: QBC: CropExact: X = 0 Y =75 W =720(0) H =425(-76)
00000048 15:36:02 RT_Debug: QBC: CropLess: XL= 0 YL=72 WL=720(0) HL=428(-76)
00000049 15:36:02 RT_Debug: QBC: CropMore: XM= 0 YM=76 WM=720(0) HM=424(-76)
00000050 15:36:02 RT_Debug: QBC: CropPlus: XP= 2 YP=80 WP=716(-2) HP=416(-80)
00000051 15:36:02 RT_Debug: QBC:
00000052 15:36:02 RT_Debug: QBC: Return: QBCropX=0 QBCropY=75 QBCropW=0 QBCropH=-76
00000053 15:36:02 RT_Debug: QBC: Return: QBCropXL=0 QBCropYL=72 QBCropWL=0 QBCropHL=-76
00000054 15:36:02 RT_Debug: QBC: Return: QBCropXM=0 QBCropYM=76 QBCropWM=0 QBCropHM=-76
00000055 15:36:02 RT_Debug: QBC: Return: QBCropXP=2 QBCropYP=80 QBCropWP=-2 QBCropHP=-80
00000056 15:36:02 RT_Debug: QBC: Return: QBCropThresh=48.000000
And the Log File written here as "Crop.Txt"
Code:
QBCropX=0 QBCropY=75 QBCropW=0 QBCropH=-76
QBCropXL=0 QBCropYL=72 QBCropWL=0 QBCropHL=-76
QBCropXM=0 QBCropYM=76 QBCropWM=0 QBCropHM=-76
QBCropXP=2 QBCropYP=80 QBCropWP=-2 QBCropHP=-80
QBCropThresh=48.000000
EDIT: Does not actually do the crop
EDIT: Now it does.