Starduster
30th August 2016, 13:59
Seems like I'm always merging a video from here with a video from there and constantly running into the differences in frame size, color, format, audio channels, frame rate, etc. I'm always finding some new parameter that doesn't match for one reason or another.
Is there any simple way to create an .avs that essentially says, make all this video's parameters the same as that one?
(almost feel bad for even asking this question...)
StainlessS
30th August 2016, 18:32
Yo, Starduster, http://www.mediafire.com/download/acsor868cx82hri/StarDuster.zip
Collection of scripts for Plugins directory, and a couple of Avisynthesizer_Mod templates that I use.
I mainly use the templates with AVI sources, I nearly always use batch script and ffmpeg to convert to AVI UT_Video codec and PCM audio,
as it is a lot easier than trying to find compatible source plugins that work without error/problem, just less hassle overall.
(I have a similar template for DGIndex VOB sources using MPeg2source instead of AviSource).
GetFile.avsi is a work in progress and not the latest version but the one that I use (latest is undergoing mods, and probably not stable).
Perhaps it works for you, perhaps not, but should be OK with AVI sources.
Little in the way of instruction I'm afraid, you'll have to figure it out, and all plugins that may be required (should be in plugins dir).
You will also need Avisynthesizer_Mod and copy templates into it's Template directory.
http://forum.doom9.org/showthread.php?t=166820&highlight=Avisynthesizer_mod
EDIT: Avisynthsizer_Mod template, can create multiple templates with modded defaults
#ASYNTHER AviSource_RoboSplice
###########################
### Status
Global G_FILECOUNT=___FILECNT___ # Set by Avisynthesizer (Used below to avoid multiple Audio Normalizing)
### Debugging
Global G_DEBUG=True
### DeBlock(G_DEBLOCK)
Global G_DEBLOCK=0
### QueryBorderCrop AND AutoContrast
Global G_SAMPLES=40
### QueryBorderCrop
Global G_QBC=True Global G_QBC_THRESH=-40.0 Global G_QBC_IGNORE = 0.2
Global G_QBC_LEFTADD=0 Global G_QBC_TOPADD=0 Global G_QBC_RIGHTADD=0 Global G_QBC_BOTADD=0
Global G_QBC_WMOD=4 Global G_QBC_HMOD=2
### AutoContrast
Global G_AC_STRENGTH=0.95 Global G_AC_GAMMA=1.0 Global G_AC_IGNORE = 0.2
### AutoGain
Global G_AUTOGAIN=False
### Auto White Balance
Global G_AWB=False
### MCDegrain(1-3) / MCDegrainSharp(Precise=G_MCD_PRECISE)
Global G_MCD=0 Global G_MCD_SHARP=False Global G_MCD_PRECISE=false
### FFT3DFilter
Global G_FFT3D_SIGMA=1.65 Global G_FFT3D_SHARPEN=0.0
### Resize with nnedi3_RPow2
Global G_RPOW2=false
### Result dimensions
Global G_DISPWID=0 Global G_DISPHIT=0
### FrameRate conversion (0,0) = No change
Global G_FRNUM=0 Global G_FRDEN=0 Global G_USE_INTERFRAME=False
### Audio
Global G_CHANNELS=2 Global G_SAMPLERATE=44100 Global G_BITS=16 Global G_NORMALIZE=(G_FILECOUNT>1)
### Result DAR (Signalled to MeGUI)
Global G_ASPECT_DARX=0 Global G_ASPECT_DARY=0
###########################
Function GetSeq(string s) {
Return AviSource(s).DoSeq()
}
[GetSeq("___FILE___")]
Starduster
30th August 2016, 19:00
Awesome! Thanks... Will take me a bit to sort through all this. Appreciate the early Christmas! ;-)
StainlessS
30th August 2016, 19:13
Use DebugView to see what its doing and order of filter adds.
eg (part 1 too big)
00000006 19:10:20.921 DoSeq: Calling RT_QueryBorderCrop
00000007 19:10:20.921 RT_QueryBorderCrop:
00000008 19:10:20.921 RT_QueryBorderCrop: RT_QueryBorderCrop v2.00Beta1 - By StainlessS
00000009 19:10:20.921 RT_QueryBorderCrop:
00000010 19:10:20.921 RT_QueryBorderCrop: Input: Width=640 Height=360 FrameCount=11900
00000011 19:10:20.921 RT_QueryBorderCrop: Thresh set to user supplied -40.00
00000012 19:10:20.921 RT_QueryBorderCrop: Thresh -40.00 recognised as DEFAULT AUTOTHRESH
00000013 19:10:20.921 RT_QueryBorderCrop: Potential Auto Credits Skip Start@5%=595 End @90%=10709 : Range=10115
00000014 19:10:20.921 RT_QueryBorderCrop: Skip Start(595) and End(10709) : Range=10115
00000015 19:10:20.921 RT_QueryBorderCrop:
00000016 19:10:20.921 RT_QueryBorderCrop: Samples=40 Thresh=-40.000 Laced=False Matrix=2
00000017 19:10:20.921 RT_QueryBorderCrop: WMod=4 HMod=2 {Colorspace/Laced Restricted XMod=2 YMod=2}
00000018 19:10:20.921 RT_QueryBorderCrop: Relative=True Prefix=QBCrop
00000019 19:10:20.921 RT_QueryBorderCrop: RLBT=15 Ignore=0.200 Baffle=4
00000020 19:10:20.921 RT_QueryBorderCrop: ScaleAutoThreshRGB=Yes ScaleAutoThreshYUV=No
00000021 19:10:20.921 RT_QueryBorderCrop: Atm=4.000 SampStart=595 SampEnd=10709 SampRange=10115
00000022 19:10:20.921 RT_QueryBorderCrop: LeftAdd=0 TopAdd=0 RightAdd=0 BotAdd=0
00000023 19:10:20.921 RT_QueryBorderCrop: LeftSkip=0 TopSkip=0 RightSkip=0 BotSkip=0
00000024 19:10:20.921 RT_QueryBorderCrop:
00000025 19:10:20.937 RT_QueryBorderCrop: AutoThresh 1) [ 595] YPlaneMin = 0 (0)
00000026 19:10:20.937 RT_QueryBorderCrop:
00000027 19:10:20.937 RT_QueryBorderCrop: YPlaneMin=0 : Automatic set Thresh=40.000
00000028 19:10:20.937 RT_QueryBorderCrop:
00000029 19:10:20.937 RT_QueryBorderCrop: Bot 1) [ 595] AveY= 40.20 Y2=349
00000030 19:10:20.937 RT_QueryBorderCrop: Lft 1) [ 595] AveY= 40.65 X1=233
00000031 19:10:20.937 RT_QueryBorderCrop: Rgt 1) [ 595] AveY= 41.46 X2=393
00000032 19:10:20.984 RT_QueryBorderCrop: Top 2) [ 854] AveY= 43.14 Y1= 66
00000033 19:10:20.984 RT_QueryBorderCrop: Bot 2) [ 854] AveY= 61.19 Y2=359
00000034 19:10:21.062 RT_QueryBorderCrop: Top 3) [ 1114] AveY= 40.99 Y1= 53
00000035 19:10:21.062 RT_QueryBorderCrop: Rgt 3) [ 1114] AveY= 40.62 X2=395
00000036 19:10:21.093 RT_QueryBorderCrop: Top 4) [ 1373] AveY= 40.93 Y1= 28
00000037 19:10:21.093 RT_QueryBorderCrop: Lft 4) [ 1373] AveY= 41.00 X1=213
00000038 19:10:21.125 RT_QueryBorderCrop: Top 5) [ 1632] AveY=176.40 Y1= 0
00000039 19:10:21.125 RT_QueryBorderCrop: Lft 5) [ 1632] AveY= 43.16 X1=190
00000040 19:10:21.125 RT_QueryBorderCrop: Rgt 5) [ 1632] AveY= 41.73 X2=418
00000041 19:10:21.187 RT_QueryBorderCrop: Lft 6) [ 1892] AveY= 40.04 X1= 60
00000042 19:10:21.265 RT_QueryBorderCrop: Lft 7) [ 2151] AveY= 40.44 X1= 39
00000043 19:10:21.265 RT_QueryBorderCrop: Rgt 7) [ 2151] AveY= 40.32 X2=572
00000044 19:10:21.328 RT_QueryBorderCrop: Lft 8) [ 2410] AveY= 48.56 X1= 0
00000045 19:10:22.000 RT_QueryBorderCrop: Rgt 23) [ 6300] AveY= 55.71 X2=639
00000046 19:10:22.000 RT_QueryBorderCrop:
00000047 19:10:22.000 RT_QueryBorderCrop: Active Frames (where image coords first found) = 9
00000048 19:10:22.000 RT_QueryBorderCrop: Sampled ImageEdge: X1=0 Y1=0 X2=639(W=640,0) Y2=359(H=360,0)
00000049 19:10:22.000 RT_QueryBorderCrop:
00000050 19:10:22.000 RT_QueryBorderCrop: CropExact: X = 0 Y = 0 W =640( 0) H =360( 0)
00000051 19:10:22.000 RT_QueryBorderCrop: CropLess: XL= 0 YL= 0 WL=640( 0) HL=360( 0)
00000052 19:10:22.000 RT_QueryBorderCrop: CropMore: XM= 0 YM= 0 WM=640( 0) HM=360( 0)
00000053 19:10:22.000 RT_QueryBorderCrop: CropPlus: XP= 2 YP= 2 WP=636( -2) HP=358( 0)
00000054 19:10:22.000 RT_QueryBorderCrop: Return:-
00000055 19:10:22.000 RT_QueryBorderCrop: QBCropX =0 QBCropY =0 QBCropW =0 QBCropH =0
00000056 19:10:22.000 RT_QueryBorderCrop: QBCropXL=0 QBCropYL=0 QBCropWL=0 QBCropHL=0
00000057 19:10:22.000 RT_QueryBorderCrop: QBCropXM=0 QBCropYM=0 QBCropWM=0 QBCropHM=0
00000058 19:10:22.000 RT_QueryBorderCrop: QBCropXP=2 QBCropYP=2 QBCropWP=-2 QBCropHP=0
00000059 19:10:22.000 RT_QueryBorderCrop: QBCropTHRESH=40.000000
00000060 19:10:22.000 RT_QueryBorderCrop: Scan Total Time=1.086 secs
00000061 19:10:22.000 RT_QueryBorderCrop:
00000062 19:10:22.015 RT_QueryLumaMinMax:
00000063 19:10:22.015 RT_QueryLumaMinMax: RT_QueryLumaMinMax v2.00Beta1 - By StainlessS
00000064 19:10:22.015 RT_QueryLumaMinMax:
00000065 19:10:22.015 RT_QueryLumaMinMax: Input: Width=640 Height=360 FrameCount=11900
00000066 19:10:22.015 RT_QueryLumaMinMax: Potential Auto Credits Skip Start@5%=595 End @90%=10709 : Range=10115
00000067 19:10:22.015 RT_QueryLumaMinMax: Skip Start(595) and End(10709) : Range=10115
00000068 19:10:22.015 RT_QueryLumaMinMax:
00000069 19:10:22.015 RT_QueryLumaMinMax: Samples=40 Ignore=0.20 Prefix=QLMM
00000070 19:10:22.015 RT_QueryLumaMinMax: X=2 Y=2 W=636 H=358 Matrix=2
00000071 19:10:22.015 RT_QueryLumaMinMax: SampStart=595 SampEnd=10709 SampRange=10115
00000072 19:10:22.015 RT_QueryLumaMinMax:
00000073 19:10:22.015 RT_QueryLumaMinMax: LumaRange: 1 ) [595 ] LumaMin = 0( 0) LumaMax = 213(213)
00000074 19:10:22.015 RT_QueryLumaMinMax: LumaRange: 2 ) [854 ] LumaMin = 0( 0) LumaMax = 192(213)
00000075 19:10:22.031 RT_QueryLumaMinMax: LumaRange: 3 ) [1114 ] LumaMin = 0( 0) LumaMax = 188(213)
00000076 19:10:22.031 RT_QueryLumaMinMax: LumaRange: 4 ) [1373 ] LumaMin = 0( 0) LumaMax = 197(213)
00000077 19:10:22.031 RT_QueryLumaMinMax: LumaRange: 5 ) [1632 ] LumaMin = 0( 0) LumaMax = 250(250)
00000078 19:10:22.031 RT_QueryLumaMinMax: LumaRange: 6 ) [1892 ] LumaMin = 0( 0) LumaMax = 200(250)
00000079 19:10:22.031 RT_QueryLumaMinMax: LumaRange: 7 ) [2151 ] LumaMin = 0( 0) LumaMax = 204(250)
00000080 19:10:22.031 RT_QueryLumaMinMax: LumaRange: 8 ) [2410 ] LumaMin = 0( 0) LumaMax = 244(250)
00000081 19:10:22.031 RT_QueryLumaMinMax: LumaRange: 9 ) [2670 ] LumaMin = 0( 0) LumaMax = 192(250)
00000082 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 10) [2929 ] LumaMin = 0( 0) LumaMax = 219(250)
00000083 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 11) [3188 ] LumaMin = 0( 0) LumaMax = 208(250)
00000084 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 12) [3448 ] LumaMin = 0( 0) LumaMax = 188(250)
00000085 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 13) [3707 ] LumaMin = 0( 0) LumaMax = 247(250)
00000086 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 14) [3966 ] LumaMin = 0( 0) LumaMax = 218(250)
00000087 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 15) [4226 ] LumaMin = 0( 0) LumaMax = 223(250)
00000088 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 16) [4485 ] LumaMin = 0( 0) LumaMax = 192(250)
00000089 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 17) [4744 ] LumaMin = 0( 0) LumaMax = 218(250)
00000090 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 18) [5004 ] LumaMin = 0( 0) LumaMax = 219(250)
00000091 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 19) [5263 ] LumaMin = 0( 0) LumaMax = 191(250)
00000092 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 20) [5522 ] LumaMin = 0( 0) LumaMax = 189(250)
00000093 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 21) [5782 ] LumaMin = 0( 0) LumaMax = 190(250)
00000094 19:10:22.046 RT_QueryLumaMinMax: LumaRange: 22) [6041 ] LumaMin = 0( 0) LumaMax = 225(250)
00000095 19:10:22.062 RT_QueryLumaMinMax: LumaRange: 23) [6300 ] LumaMin = 0( 0) LumaMax = 221(250)
00000096 19:10:22.078 RT_QueryLumaMinMax: LumaRange: 24) [6560 ] LumaMin = 0( 0) LumaMax = 191(250)
00000097 19:10:22.093 RT_QueryLumaMinMax: LumaRange: 25) [6819 ] LumaMin = 0( 0) LumaMax = 190(250)
00000098 19:10:22.125 RT_QueryLumaMinMax: LumaRange: 26) [7078 ] LumaMin = 0( 0) LumaMax = 187(250)
00000099 19:10:22.140 RT_QueryLumaMinMax: LumaRange: 27) [7338 ] LumaMin = 0( 0) LumaMax = 234(250)
00000100 19:10:22.156 RT_QueryLumaMinMax: LumaRange: 28) [7597 ] LumaMin = 0( 0) LumaMax = 191(250)
00000101 19:10:22.171 RT_QueryLumaMinMax: LumaRange: 29) [7856 ] LumaMin = 0( 0) LumaMax = 186(250)
00000102 19:10:22.187 RT_QueryLumaMinMax: LumaRange: 30) [8116 ] LumaMin = 0( 0) LumaMax = 213(250)
00000103 19:10:22.203 RT_QueryLumaMinMax: LumaRange: 31) [8375 ] LumaMin = 0( 0) LumaMax = 202(250)
00000104 19:10:22.234 RT_QueryLumaMinMax: LumaRange: 32) [8634 ] LumaMin = 0( 0) LumaMax = 187(250)
00000105 19:10:22.250 RT_QueryLumaMinMax: LumaRange: 33) [8894 ] LumaMin = 0( 0) LumaMax = 244(250)
00000106 19:10:22.265 RT_QueryLumaMinMax: LumaRange: 34) [9153 ] LumaMin = 0( 0) LumaMax = 189(250)
00000107 19:10:22.281 RT_QueryLumaMinMax: LumaRange: 35) [9412 ] LumaMin = 0( 0) LumaMax = 189(250)
00000108 19:10:22.296 RT_QueryLumaMinMax: LumaRange: 36) [9672 ] LumaMin = 0( 0) LumaMax = 186(250)
00000109 19:10:22.312 RT_QueryLumaMinMax: LumaRange: 37) [9931 ] LumaMin = 0( 0) LumaMax = 187(250)
00000110 19:10:22.328 RT_QueryLumaMinMax: LumaRange: 38) [10190] LumaMin = 0( 0) LumaMax = 188(250)
00000111 19:10:22.328 RT_QueryLumaMinMax: LumaRange: 39) [10450] LumaMin = 0( 0) LumaMax = 253(253)
00000112 19:10:22.359 RT_QueryLumaMinMax: LumaRange: 40) [10709] LumaMin = 0( 0) LumaMax = 187(253)
00000113 19:10:22.359 RT_QueryLumaMinMax:
00000114 19:10:22.359 RT_QueryLumaMinMax: Return: QLMMMin=0 QLMMMax=253
00000115 19:10:22.359 RT_QueryLumaMinMax: Scan Total Time=0.341 secs
00000116 19:10:22.359 RT_QueryLumaMinMax:
00000117 19:10:22.359 AutoContrast: Levels( 1,1.00,252,16,235,Coring=False)
00000118 19:10:22.359 DoSeq: QBC::Crop(0,0,0,0)
00000119 19:10:22.359 DoSeq: FFT3DFilter(Sigma=1.650000,Sharpen=0.000000)
00000120 19:10:22.515 DoSeq: Using Original SIZE 640 360
00000121 19:10:22.515 DoSeq: Assuming FrameRate 25.000 (sync_audio=True)
00000122 19:10:22.531 DoSeq: NORMALIZING AUDIO
00000123 19:10:22.546 DoSeq: Calling RT_QueryBorderCrop
StainlessS
30th August 2016, 19:14
Part 2
00000124 19:10:22.546 RT_QueryBorderCrop:
00000125 19:10:22.546 RT_QueryBorderCrop: RT_QueryBorderCrop v2.00Beta1 - By StainlessS
00000126 19:10:22.546 RT_QueryBorderCrop:
00000127 19:10:22.546 RT_QueryBorderCrop: Input: Width=848 Height=480 FrameCount=7474
00000128 19:10:22.546 RT_QueryBorderCrop: Thresh set to user supplied -40.00
00000129 19:10:22.546 RT_QueryBorderCrop: Thresh -40.00 recognised as DEFAULT AUTOTHRESH
00000130 19:10:22.546 RT_QueryBorderCrop: Potential Auto Credits Skip Start@5%=374 End @90%=6726 : Range=6353
00000131 19:10:22.546 RT_QueryBorderCrop: Skip Start(374) and End(6726) : Range=6353
00000132 19:10:22.546 RT_QueryBorderCrop:
00000133 19:10:22.546 RT_QueryBorderCrop: Samples=40 Thresh=-40.000 Laced=False Matrix=2
00000134 19:10:22.546 RT_QueryBorderCrop: WMod=4 HMod=2 {Colorspace/Laced Restricted XMod=2 YMod=2}
00000135 19:10:22.546 RT_QueryBorderCrop: Relative=True Prefix=QBCrop
00000136 19:10:22.546 RT_QueryBorderCrop: RLBT=15 Ignore=0.200 Baffle=4
00000137 19:10:22.546 RT_QueryBorderCrop: ScaleAutoThreshRGB=Yes ScaleAutoThreshYUV=No
00000138 19:10:22.546 RT_QueryBorderCrop: Atm=4.000 SampStart=374 SampEnd=6726 SampRange=6353
00000139 19:10:22.546 RT_QueryBorderCrop: LeftAdd=0 TopAdd=0 RightAdd=0 BotAdd=0
00000140 19:10:22.546 RT_QueryBorderCrop: LeftSkip=0 TopSkip=0 RightSkip=0 BotSkip=0
00000141 19:10:22.546 RT_QueryBorderCrop:
00000142 19:10:22.562 RT_QueryBorderCrop: AutoThresh 1) [ 374] YPlaneMin = 3 (3)
00000143 19:10:22.593 RT_QueryBorderCrop: AutoThresh 2) [ 537] YPlaneMin = 3 (3)
00000144 19:10:22.609 RT_QueryBorderCrop: AutoThresh 3) [ 700] YPlaneMin = 3 (3)
00000145 19:10:22.687 RT_QueryBorderCrop: AutoThresh 4) [ 863] YPlaneMin = 3 (3)
00000146 19:10:22.828 RT_QueryBorderCrop: AutoThresh 5) [ 1025] YPlaneMin = 3 (3)
00000147 19:10:22.859 RT_QueryBorderCrop: AutoThresh 6) [ 1188] YPlaneMin = 3 (3)
00000148 19:10:22.921 RT_QueryBorderCrop: AutoThresh 7) [ 1351] YPlaneMin = 3 (3)
00000149 19:10:22.953 RT_QueryBorderCrop: AutoThresh 8) [ 1514] YPlaneMin = 3 (3)
00000150 19:10:23.031 RT_QueryBorderCrop: AutoThresh 9) [ 1677] YPlaneMin = 3 (3)
00000151 19:10:23.062 RT_QueryBorderCrop: AutoThresh 10) [ 1840] YPlaneMin = 3 (3)
00000152 19:10:23.078 RT_QueryBorderCrop: AutoThresh 11) [ 2003] YPlaneMin = 4 (3)
00000153 19:10:23.109 RT_QueryBorderCrop: AutoThresh 12) [ 2166] YPlaneMin = 3 (3)
00000154 19:10:23.125 RT_QueryBorderCrop: AutoThresh 13) [ 2328] YPlaneMin = 4 (3)
00000155 19:10:23.187 RT_QueryBorderCrop: AutoThresh 14) [ 2491] YPlaneMin = 3 (3)
00000156 19:10:23.250 RT_QueryBorderCrop: AutoThresh 15) [ 2654] YPlaneMin = 4 (3)
00000157 19:10:23.390 RT_QueryBorderCrop: AutoThresh 16) [ 2817] YPlaneMin = 3 (3)
00000158 19:10:23.406 RT_QueryBorderCrop: AutoThresh 17) [ 2980] YPlaneMin = 3 (3)
00000159 19:10:23.421 RT_QueryBorderCrop: AutoThresh 18) [ 3143] YPlaneMin = 3 (3)
00000160 19:10:23.437 RT_QueryBorderCrop: AutoThresh 19) [ 3306] YPlaneMin = 3 (3)
00000161 19:10:23.468 RT_QueryBorderCrop: AutoThresh 20) [ 3469] YPlaneMin = 3 (3)
00000162 19:10:23.484 RT_QueryBorderCrop: AutoThresh 21) [ 3631] YPlaneMin = 3 (3)
00000163 19:10:23.546 RT_QueryBorderCrop: AutoThresh 22) [ 3794] YPlaneMin = 3 (3)
00000164 19:10:23.625 RT_QueryBorderCrop: AutoThresh 23) [ 3957] YPlaneMin = 3 (3)
00000165 19:10:23.687 RT_QueryBorderCrop: AutoThresh 24) [ 4120] YPlaneMin = 3 (3)
00000166 19:10:23.734 RT_QueryBorderCrop: AutoThresh 25) [ 4283] YPlaneMin = 3 (3)
00000167 19:10:23.781 RT_QueryBorderCrop: AutoThresh 26) [ 4446] YPlaneMin = 3 (3)
00000168 19:10:23.828 RT_QueryBorderCrop: AutoThresh 27) [ 4609] YPlaneMin = 3 (3)
00000169 19:10:23.843 RT_QueryBorderCrop: AutoThresh 28) [ 4772] YPlaneMin = 3 (3)
00000170 19:10:23.875 RT_QueryBorderCrop: AutoThresh 29) [ 4934] YPlaneMin = 3 (3)
00000171 19:10:23.921 RT_QueryBorderCrop: AutoThresh 30) [ 5097] YPlaneMin = 3 (3)
00000172 19:10:23.937 RT_QueryBorderCrop: AutoThresh 31) [ 5260] YPlaneMin = 3 (3)
00000173 19:10:23.968 RT_QueryBorderCrop: AutoThresh 32) [ 5423] YPlaneMin = 3 (3)
00000174 19:10:24.062 RT_QueryBorderCrop: AutoThresh 33) [ 5586] YPlaneMin = 3 (3)
00000175 19:10:24.109 RT_QueryBorderCrop: AutoThresh 34) [ 5749] YPlaneMin = 3 (3)
00000176 19:10:24.140 RT_QueryBorderCrop: AutoThresh 35) [ 5912] YPlaneMin = 3 (3)
00000177 19:10:24.156 RT_QueryBorderCrop: AutoThresh 36) [ 6075] YPlaneMin = 3 (3)
00000178 19:10:24.187 RT_QueryBorderCrop: AutoThresh 37) [ 6237] YPlaneMin = 3 (3)
00000179 19:10:24.234 RT_QueryBorderCrop: AutoThresh 38) [ 6400] YPlaneMin = 3 (3)
00000180 19:10:24.296 RT_QueryBorderCrop: AutoThresh 39) [ 6563] YPlaneMin = 3 (3)
00000181 19:10:24.312 RT_QueryBorderCrop: AutoThresh 40) [ 6726] YPlaneMin = 3 (3)
00000182 19:10:24.312 RT_QueryBorderCrop:
00000183 19:10:24.312 RT_QueryBorderCrop: YPlaneMin=3 : Automatic set Thresh=43.000
00000184 19:10:24.312 RT_QueryBorderCrop:
00000185 19:10:24.312 RT_QueryBorderCrop: Top 1) [ 374] AveY=168.72 Y1= 0
00000186 19:10:24.312 RT_QueryBorderCrop: Bot 1) [ 374] AveY=201.77 Y2=479
00000187 19:10:24.312 RT_QueryBorderCrop: Lft 1) [ 374] AveY=161.26 X1= 0
00000188 19:10:24.312 RT_QueryBorderCrop: Rgt 1) [ 374] AveY=200.39 X2=847
00000189 19:10:24.312 RT_QueryBorderCrop:
00000190 19:10:24.312 RT_QueryBorderCrop: Active Frames (where image coords first found) = 1
00000191 19:10:24.312 RT_QueryBorderCrop: Sampled ImageEdge: X1=0 Y1=0 X2=847(W=848,0) Y2=479(H=480,0)
00000192 19:10:24.312 RT_QueryBorderCrop:
00000193 19:10:24.312 RT_QueryBorderCrop: CropExact: X = 0 Y = 0 W =848( 0) H =480( 0)
00000194 19:10:24.312 RT_QueryBorderCrop: CropLess: XL= 0 YL= 0 WL=848( 0) HL=480( 0)
00000195 19:10:24.312 RT_QueryBorderCrop: CropMore: XM= 0 YM= 0 WM=848( 0) HM=480( 0)
00000196 19:10:24.312 RT_QueryBorderCrop: CropPlus: XP= 2 YP= 2 WP=844( -2) HP=478( 0)
00000197 19:10:24.312 RT_QueryBorderCrop: Return:-
00000198 19:10:24.312 RT_QueryBorderCrop: QBCropX =0 QBCropY =0 QBCropW =0 QBCropH =0
00000199 19:10:24.312 RT_QueryBorderCrop: QBCropXL=0 QBCropYL=0 QBCropWL=0 QBCropHL=0
00000200 19:10:24.312 RT_QueryBorderCrop: QBCropXM=0 QBCropYM=0 QBCropWM=0 QBCropHM=0
00000201 19:10:24.312 RT_QueryBorderCrop: QBCropXP=2 QBCropYP=2 QBCropWP=-2 QBCropHP=0
00000202 19:10:24.312 RT_QueryBorderCrop: QBCropTHRESH=43.000000
00000203 19:10:24.312 RT_QueryBorderCrop: Scan Total Time=1.772 secs
00000204 19:10:24.312 RT_QueryBorderCrop:
00000205 19:10:24.328 RT_QueryLumaMinMax:
00000206 19:10:24.328 RT_QueryLumaMinMax: RT_QueryLumaMinMax v2.00Beta1 - By StainlessS
00000207 19:10:24.328 RT_QueryLumaMinMax:
00000208 19:10:24.328 RT_QueryLumaMinMax: Input: Width=848 Height=480 FrameCount=7474
00000209 19:10:24.328 RT_QueryLumaMinMax: Potential Auto Credits Skip Start@5%=374 End @90%=6726 : Range=6353
00000210 19:10:24.328 RT_QueryLumaMinMax: Skip Start(374) and End(6726) : Range=6353
00000211 19:10:24.328 RT_QueryLumaMinMax:
00000212 19:10:24.328 RT_QueryLumaMinMax: Samples=40 Ignore=0.20 Prefix=QLMM
00000213 19:10:24.328 RT_QueryLumaMinMax: X=2 Y=2 W=844 H=478 Matrix=2
00000214 19:10:24.328 RT_QueryLumaMinMax: SampStart=374 SampEnd=6726 SampRange=6353
00000215 19:10:24.328 RT_QueryLumaMinMax:
00000216 19:10:24.328 RT_QueryLumaMinMax: LumaRange: 1 ) [374 ] LumaMin = 3( 3) LumaMax = 254(254)
00000217 19:10:24.343 RT_QueryLumaMinMax: LumaRange: 2 ) [537 ] LumaMin = 3( 3) LumaMax = 255(255)
00000218 19:10:24.343 RT_QueryLumaMinMax: LumaRange: 3 ) [700 ] LumaMin = 3( 3) LumaMax = 254(255)
00000219 19:10:24.343 RT_QueryLumaMinMax: LumaRange: 4 ) [863 ] LumaMin = 3( 3) LumaMax = 254(255)
00000220 19:10:24.343 RT_QueryLumaMinMax: LumaRange: 5 ) [1025 ] LumaMin = 3( 3) LumaMax = 254(255)
00000221 19:10:24.343 RT_QueryLumaMinMax: LumaRange: 6 ) [1188 ] LumaMin = 3( 3) LumaMax = 254(255)
00000222 19:10:24.343 RT_QueryLumaMinMax: LumaRange: 7 ) [1351 ] LumaMin = 3( 3) LumaMax = 254(255)
00000223 19:10:24.359 RT_QueryLumaMinMax: LumaRange: 8 ) [1514 ] LumaMin = 3( 3) LumaMax = 255(255)
00000224 19:10:24.359 RT_QueryLumaMinMax: LumaRange: 9 ) [1677 ] LumaMin = 3( 3) LumaMax = 255(255)
00000225 19:10:24.359 RT_QueryLumaMinMax: LumaRange: 10) [1840 ] LumaMin = 3( 3) LumaMax = 255(255)
00000226 19:10:24.359 RT_QueryLumaMinMax: LumaRange: 11) [2003 ] LumaMin = 4( 3) LumaMax = 254(255)
00000227 19:10:24.359 RT_QueryLumaMinMax: LumaRange: 12) [2166 ] LumaMin = 3( 3) LumaMax = 255(255)
00000228 19:10:24.359 RT_QueryLumaMinMax: LumaRange: 13) [2328 ] LumaMin = 4( 3) LumaMax = 255(255)
00000229 19:10:24.375 RT_QueryLumaMinMax: LumaRange: 14) [2491 ] LumaMin = 3( 3) LumaMax = 254(255)
00000230 19:10:24.375 RT_QueryLumaMinMax: LumaRange: 15) [2654 ] LumaMin = 3( 3) LumaMax = 254(255)
00000231 19:10:24.375 RT_QueryLumaMinMax: LumaRange: 16) [2817 ] LumaMin = 3( 3) LumaMax = 255(255)
00000232 19:10:24.375 RT_QueryLumaMinMax: LumaRange: 17) [2980 ] LumaMin = 3( 3) LumaMax = 255(255)
00000233 19:10:24.375 RT_QueryLumaMinMax: LumaRange: 18) [3143 ] LumaMin = 3( 3) LumaMax = 255(255)
00000234 19:10:24.375 RT_QueryLumaMinMax: LumaRange: 19) [3306 ] LumaMin = 3( 3) LumaMax = 254(255)
00000235 19:10:24.390 RT_QueryLumaMinMax: LumaRange: 20) [3469 ] LumaMin = 3( 3) LumaMax = 254(255)
00000236 19:10:24.390 RT_QueryLumaMinMax: LumaRange: 21) [3631 ] LumaMin = 3( 3) LumaMax = 255(255)
00000237 19:10:24.390 RT_QueryLumaMinMax: LumaRange: 22) [3794 ] LumaMin = 3( 3) LumaMax = 254(255)
00000238 19:10:24.390 RT_QueryLumaMinMax: LumaRange: 23) [3957 ] LumaMin = 3( 3) LumaMax = 254(255)
00000239 19:10:24.390 RT_QueryLumaMinMax: LumaRange: 24) [4120 ] LumaMin = 3( 3) LumaMax = 254(255)
00000240 19:10:24.390 RT_QueryLumaMinMax: LumaRange: 25) [4283 ] LumaMin = 3( 3) LumaMax = 254(255)
00000241 19:10:24.390 RT_QueryLumaMinMax: LumaRange: 26) [4446 ] LumaMin = 3( 3) LumaMax = 254(255)
00000242 19:10:24.406 RT_QueryLumaMinMax: LumaRange: 27) [4609 ] LumaMin = 3( 3) LumaMax = 255(255)
00000243 19:10:24.406 RT_QueryLumaMinMax: LumaRange: 28) [4772 ] LumaMin = 3( 3) LumaMax = 255(255)
00000244 19:10:24.406 RT_QueryLumaMinMax: LumaRange: 29) [4934 ] LumaMin = 3( 3) LumaMax = 254(255)
00000245 19:10:24.406 RT_QueryLumaMinMax: LumaRange: 30) [5097 ] LumaMin = 3( 3) LumaMax = 254(255)
00000246 19:10:24.406 RT_QueryLumaMinMax: LumaRange: 31) [5260 ] LumaMin = 3( 3) LumaMax = 255(255)
00000247 19:10:24.406 RT_QueryLumaMinMax: LumaRange: 32) [5423 ] LumaMin = 3( 3) LumaMax = 254(255)
00000248 19:10:24.421 RT_QueryLumaMinMax: LumaRange: 33) [5586 ] LumaMin = 3( 3) LumaMax = 254(255)
00000249 19:10:24.421 RT_QueryLumaMinMax: LumaRange: 34) [5749 ] LumaMin = 3( 3) LumaMax = 255(255)
00000250 19:10:24.421 RT_QueryLumaMinMax: LumaRange: 35) [5912 ] LumaMin = 3( 3) LumaMax = 254(255)
00000251 19:10:24.421 RT_QueryLumaMinMax: LumaRange: 36) [6075 ] LumaMin = 3( 3) LumaMax = 254(255)
00000252 19:10:24.421 RT_QueryLumaMinMax: LumaRange: 37) [6237 ] LumaMin = 3( 3) LumaMax = 254(255)
00000253 19:10:24.421 RT_QueryLumaMinMax: LumaRange: 38) [6400 ] LumaMin = 3( 3) LumaMax = 254(255)
00000254 19:10:24.437 RT_QueryLumaMinMax: LumaRange: 39) [6563 ] LumaMin = 3( 3) LumaMax = 254(255)
00000255 19:10:24.437 RT_QueryLumaMinMax: LumaRange: 40) [6726 ] LumaMin = 3( 3) LumaMax = 254(255)
00000256 19:10:24.437 RT_QueryLumaMinMax:
00000257 19:10:24.437 RT_QueryLumaMinMax: Return: QLMMMin=3 QLMMMax=255
00000258 19:10:24.437 RT_QueryLumaMinMax: Scan Total Time=0.098 secs
00000259 19:10:24.437 RT_QueryLumaMinMax:
00000260 19:10:24.437 AutoContrast: Levels( 4,1.00,254,16,235,Coring=False)
00000261 19:10:24.437 DoSeq: QBC::Crop(0,0,0,0)
00000262 19:10:24.437 DoSeq: FFT3DFilter(Sigma=1.650000,Sharpen=0.000000)
00000263 19:10:24.593 RT_DebugF: Resizing to match 640x360
00000264 19:10:24.609 DoSeq: Assuming FrameRate 25.000 (sync_audio=True)
00000265 19:10:24.625 DoSeq: NORMALIZING AUDIO
EDIT: Above, two dissimilar dimension avi's spliced. Output characteristics same as first one (or Global Defaults if non zero)
EDIT: I actually use above a lot, even with single source file as it is a doddle to config without writing a lot of script.
EDIT: The end of the template is turned from this,
[GetSeq("___FILE___")]
into eg this
GetSeq("D:\File1.AVI") ++ \
GetSeq("D:\File2.AVI")
IF a BATCH Template (without square brackets ie '[' and ']') then
GetSeq("___FILE___")
creates two separate avs scripts, one for each source file
GetSeq("D:\File1.AVI")
and
GetSeq("D:\File2.AVI")
Both preceded by the Template Globals.
Starduster
31st August 2016, 10:44
Leaving for a ride up to Mackinaw. Will look more at this after the weekend.
raffriff42
6th September 2016, 03:41
Seems like I'm always merging a video from here with a video from there and constantly running into the differences in frame size, color, format, audio channels, frame rate, etc. I'm always finding some new parameter that doesn't match for one reason or another.
Is there any simple way to create an .avs that essentially says, make all this video's parameters the same as that one?I have some scripts in my toolbox that may help.
Matching some properties are simple, others are hard - for example, frame rate: do you want to keep the frames intact and change the running time, or keep the running time but blend the frames somehow? And size: do you need to change aspect ratio?
EDIT an example; given two clips we want to cut together:
* A = main video; let's say it's YV12, 1280x720, 24fps, 2ch audio, 44100 Hz
* B = cutaway; let's say it's RGB32, 640x480, 29.97fps, 1ch audio, 48000 Hz
B = B.UUMatchAudioFormat(A, allowresample=true)
\ .UUMatchColorFormat(A, matrix="Rec709")
\ .Spline64Resize(B.CalcWidth(A.Height), A.Height) ## resize to A.Height, keeping aspect ratio
\ .UUSize(A.Width, A.Height) ## crop or add borders to make width equal
\ .ConvertFPS(A)
return A.Trim(0, 99)
\ + B.Trim(0, 24)
\ + A.Trim(124, 0)
##################################
### Match audio properties of source C to template T
## (for ease of splicing, interleaving etc)
## Properties matched:
## number of channels (see note), bit depth,
## sample rate (if allowresample=true)
##
## AudioChannels handling:
## if T has no audio, returns C.KillAudio;
## if C has no audio, copies silenced audio from T;
## if T and C have the same channel count, no change is made;
## if T has 1 channel, returns C.ConvertToMono;
## if T has 2 channels and C has 1, returns C with split mono;
## otherwise, an error is raised (manual intervention is needed)
##
## @ allowresample - if true, resample audio to match template if needed;
## if false (the default), use AssumeSampleRate,
## which may affect audio/video sync.
##
function UUMatchAudioFormat(clip C, clip T, bool "allowresample")
{
Assert(IsClip(C),
\ "UUMatchAudioFormat: clip 'C' invalid")
Assert(IsClip(T),
\ "UUMatchAudioFormat: clip 'T' invalid")
allowresample = Default(allowresample, false)
D = (T.HasAudio==false) ? C.KillAudio
\ : (C.HasAudio==false) ? C.AudioDub(T.Loop).Amplify(0)
\ : (C.AudioChannels==T.AudioChannels) ? C
\ : (C.AudioChannels==2 && T.AudioChannels==1) ? C.ConvertToMono
\ : (C.AudioChannels==1 && T.AudioChannels==2) ? C.MergeChannels(C, C)
\ : Assert(false,
\ "UUMatchAudioFormat: channels > 2")
## use AssumeSampleRate if:
## (1) pitch shift less than (arbitrary) 2%
## (2) change in duration less than (arbitrary) 25 msec
dur = (C.HasAudio) ? C.AudioDuration : 0.0
Tfr = (T.HasAudio) ? T.AudioRate : 0
Cfr = (C.HasAudio) ? C.AudioRate : 0
Tff = Float(Tfr)
Cff = Float(Cfr)
asok = (allowresample==false) ? true
\ : (Tfr<1 || Cfr<1) ? false
\ : (Abs(1.0 - Tff / Cff) <= 0.02) &&
\ (Abs(dur - (dur * Tff / Cff)) < 0.025)
## else, use SSRC if sample rate ratio is allowed:
## http://avisynth.nl/index.php/SSRC
frqgcd = (Tfr<1 || Cfr<1) ? 1 : _gcd(Cfr, Tfr)
fs1 = (Tfr > Cfr) ? (Cfr / frqgcd) : (Tfr / frqgcd)
ssok = (frqgcd>1) && ((fs1==1) || ((fs1 % 2)==0) || ((fs1 % 3)==0))
## ...else, use ResampleAudio
rsok = (Tfr>=1 && Cfr>=1)
D = (Cfr==Tfr) ? D
\ : (asok) ? D.AssumeSampleRate(Tfr)
\ : (ssok) ? D.ConvertAudioToFloat.SSRC(Tfr)
\ : (rsok) ? D.ConvertAudioToFloat.ResampleAudio(Tfr)
\ : D
D = (Tfr<1 || Cfr<1) ? D
\ : (D.IsAudioFloat==T.IsAudioFloat) && (D.AudioBits==T.AudioBits) ? D
\ : (T.IsAudioFloat) ? D.ConvertAudioToFloat
\ : (T.AudioBits==32) ? D.ConvertAudioTo32bit
\ : (T.AudioBits==24) ? D.ConvertAudioTo24bit
\ : (T.AudioBits==16) ? D.ConvertAudioTo16bit
\ : (T.AudioBits==8) ? D.ConvertAudioTo8bit
\ : Assert(false,
\ "UUMatchAudioFormat: unrecognized sample format")
return D
}
# http://users.telenet.be/darnley/avisynth/mine.html
##################################
## Greatest Common Divisor
function _gcd(int x, int y)
{
t = x % y
x = y
y = t
return (y>0) ? _gcd(x, y) : x
}
##################################
### Match color format of source C to template T
## (for ease of splicing, interleaving etc)
##
## @ matrix - ignored if not converting between RGB<>YUV; default "Rec601"
##
function UUMatchColorFormat(clip C, clip T, string "matrix")
{
Assert(IsClip(C) && HasVideo(C),
\ "UUMatchColorFormat: clip 'C' invalid")
Assert(IsClip(T) && HasVideo(T),
\ "UUMatchColorFormat: clip 'T' invalid")
matrix = Default(matrix, "Rec601")
return (T.IsRGB32)
\ ? (C.IsRGB)
\ ? C.ConvertToRGB32
\ : C.ConvertToRGB32(matrix=matrix)
\ : (T.IsRGB24)
\ ? (C.IsRGB)
\ ? C.ConvertToRGB24
\ : C.ConvertToRGB24(matrix=matrix)
\ : (T.IsYV24)
\ ? (C.IsRGB)
\ ? C.ConvertToYV24(matrix=matrix)
\ : C.ConvertToYV24
\ : (T.IsYV16)
\ ? (C.IsRGB)
\ ? C.ConvertToYV16(matrix=matrix)
\ : C.ConvertToYV16
\ : (T.IsYV12)
\ ? (C.IsRGB)
\ ? C.ConvertToYV12(matrix=matrix)
\ : C.ConvertToYV12
\ : (T.IsY8)
\ ? (C.IsRGB)
\ ? C.ConvertToYV12(matrix=matrix).ConvertToY8
\ : C.ConvertToYV12.ConvertToY8
\ : (T.IsYUY2)
\ ? (C.IsRGB)
\ ? C.ConvertToYUY2(matrix=matrix)
\ : C.ConvertToYUY2
\ : Assert(false, "UUMatchColorFormat: unrecognized source format")
## note <<.ConvertToYV12>>.ConvertToY8
## required to avoid a possible H-shift problem
}
##################################
### symmetrically crop or add borders to ensure clip is a certain size
##
## @ wid, hgt - new desired width & height
##
function UUSize(clip C, int wid, int hgt)
{
C
bdrX = wid - Width
bdrY = hgt - Height
bdrLt = Ceil(Float(bdrX) / 2.0)
bdrTp = Ceil(Float(bdrY) / 2.0)
bdrLt = bdrLt - (bdrLt % 2)
bdrTp = bdrTp - (bdrTp % 2)
bdrRt = (bdrX - bdrLt)
bdrBt = (bdrY - bdrTp)
AddBorders(
\ Max(0, bdrLt), Max(0, bdrTp),
\ Max(0, bdrRt), Max(0, bdrBt))
Crop(
\ ((bdrLt < 0) ? -bdrLt : 0),
\ ((bdrTp < 0) ? -bdrTp : 0),
\ ((bdrRt < 0) ? bdrRt : wid),
\ ((bdrBt < 0) ? bdrBt : hgt))
return Last
}
###############################
### given new height, calculate new width, preserving aspect ratio
##
## @ mod - new height & width will be divisible by this number
## (allowed values 1|2|4|8|16|32, default 2)
##
function CalcWidth(clip C, int new_hgt, int "mod")
{
mod = Default(mod, 2)
Assert(C.hasVideo,
\ "CalcWidth: invalid source clip 'C'")
Assert(new_hgt>0,
\ "CalcWidth: 'new_hgt' must be > 0")
Assert((mod==1||mod==2||mod==4||mod==8||mod==16||mod==32),
\ "CalcWidth: 'mod' argument not one of (1|2|4|8|16|32)")
aspect = Float(C.Width) / Float(C.Height)
new_wid = uumod(mod, Float(new_hgt)*aspect)
return new_wid
}
###############################
### given new width, calculate new height, preserving aspect ratio
##
## @ mod - new height & width will be divisible by this number
## (allowed values 1|2|4|8|16|32, default 2)
##
function CalcHeight(clip C, int new_wid, int "mod")
{
mod = Default(mod, 2)
Assert(C.hasVideo,
\ "CalcHeight: invalid source clip 'C'")
Assert(new_wid>0,
\ "CalcHeight: 'new_wid' must be > 0")
Assert((mod==1||mod==2||mod==4||mod==8||mod==16||mod==32),
\ "CalcHeight: 'mod' argument not one of (1|2|4|8|16|32)")
aspect = Float(C.Width) / Float(C.Height)
new_hgt = uumod(mod, Float(new_wid)/aspect)
return new_hgt
}
##################################
## return argument 'f' as integer and ensure it is Mod 'm'
##
## @ m - mod value
## @ f - input (may be positive or negative)
##
function uumod(int m, float f)
{
m = Max(1, m)
fsgn = Sign(f)
i = Floor(Abs(f))
return fsgn * Max(0, i - (i % m))
}
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.