Thread: Avisynth+
View Single Post
Old 22nd October 2019, 08:33   #4924  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by StainlessS View Post
Nice theory P

But, what about this one then [no SeparateRows]

Code:
FAIL = False  # Force Falure ?
C=0
For(i=0,255) {
    C2=BlankClip(Pixel_Type="Y8",Length=1,Color_YUV=(i*256+$80)*256+$80)
    C=(!c.IsClip) ? C2 : C ++ C2
}
C    # 256 frames, Y ascending

Len = (FAIL) ? 1 : FrameCount

K=Last.BlankClip(Length=Len,Pixel_Type="Y8",Color_YUV=$008080).Subtitle("[FAIL=" + String(FAIL) + "] Is NOT greater than 100.0",Align=5)
W=Last.BlankClip(Length=Len,Pixel_Type="Y8",Color_YUV=$FF8080).Subtitle("[FAIL=" + String(FAIL) + "] Is greater than 100.0",Align=5)

ConditionalFilter(W,K,"averageLuma >= 100.0 ",Show=true)
C=C.Scriptclip("""Subtitle(String(current_frame,"%.0f] Y=") + String(AverageLuma,"%.2f"))""")
StackHorizontal(C,Last)

#Trim(255,-1)    # Only show last frame where result should be WHITE.
I had posted this earlier in this thread [as EDIT] but forgot, here:- http://forum.doom9.org/showthread.ph...79#post1886179

EDIT: both W and K have to be single frame to fail, I cant re-check as I'm in middle of system restore from image.
EDIT: I would expect it to behave like the other runtime filters, it is commonplace to return a single frame in eg Scriptclip, makes no difference to length of outut
clip, which is guaranteed same as input.
Works as expected. The frame count of ConditionalFilter depends only on W and K, namely max(K.FrameCount, W.FrameCount).
See https://github.com/AviSynth/AviSynth...ional.cpp#L233

So the output contains exactly 1 frames and when you do StackHorizontal with the original 256-frame clip, it will show the same single frame on the right.
pinterf is offline