View Single Post
Old 11th April 2021, 08:21   #3  |  Link
Arx1meD
Registered User
 
Arx1meD's Avatar
 
Join Date: Feb 2021
Posts: 121
I use OutRange to find the maximum and minimum luma values.
My simplified version of OutRange:
Code:
Function OutRange2(clip c, float "thr", bool "Y", bool "U", bool "V", int "borders", string "filename") {
thr = String(Default(thr, 0.0))
Y   = Default(Y, true)
U   = Default(U, false)
V   = Default(V, false)
br  = Default(borders, 0)
FN  = Default(filename, "OutRange.log")

Assert(Y || U || V, "OutRange: One of channel Y or U or V mast be true")

Yeval = Y ? "ymax=YPlaneMax("+thr+") ymin=YPlaneMin("+thr+")" : """ "" """
Ueval = U ? "umax=UPlaneMax("+thr+") umin=UPlaneMin("+thr+")" : """ "" """
Veval = V ? "vmax=VPlaneMax("+thr+") vmin=VPlaneMin("+thr+")" : """ "" """

wriY = Y ? """ "YMax = " + String(ymax) + "; YMin = " + String(ymin) """ : """ "" """
wriU = U ? """ "UMax = " + String(umax) + "; UMin = " + String(Umin) """ : """ "" """
wriV = V ? """ "VMax = " + String(vmax) + "; VMin = " + String(vmin) """ : """ "" """

expe = Yeval + Chr(10) + Ueval + Chr(10) + Veval

expw = wriY + String(Y && (U || V) ? """ + "; " + """ : """ + "" + """) 
   \ + wriU + String(U && V ? """ + "; " + """ : """ + "" + """)
   \ + wriV

c.Crop(br, br, -br, -br)
FrameEvaluate(expe)
WriteFile(last, FN, "current_frame", """ ": " """, expw)
}
For example:
Code:
LWLibavVideoSource("C:\MV02\VideoFile.mkv")
Import(C:\AVS\OutRange.avsi")
OutRange2(thr=0, Y=true, U=false, V=false, borders=10, filename="OutRange.log")
Run it in AVSMeter to collect frame statistics. The "OutRange.log" file will be created.

To smooth the levels on the graphs use the SmoothLevels filter, this is the easiest way. Or a combination of filters after Levels(...):
Code:
UnDot()
MiniDeen(radiusY=1, radiusUV=1, thrY=10, thrUV=12, y=3, u=3, v=3)
f3kdb(preset="low/nograin", sample_mode=2)

Last edited by Arx1meD; 11th April 2021 at 12:37.
Arx1meD is offline   Reply With Quote