View Single Post
Old 27th August 2020, 13:28   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Im kinda curious if SpotLess could do anything here [AND ALSO with your problem in other thread],
(It could be that old thing TheFluff keeps on saying, something like, "when all you have is a hammer, every problem looks like a nail", or summick like that).
But might still be worth a try.
Maybe try something like, [both of these, varying RadT downwards, maybe in steps of 5 at first]
Code:
SpotLess(RadT=30, ThSAD2=10000,BlkSz=32)
and
Code:
SpotLess(RadT=30, ThSAD2=400,BlkSz=32)
cant do any harm to try. [do report good or bad, I'm not expecting anything particularly good, but hell, its worth a shot, and it aint the end of the world if it fails].
If it does fix some, then might be required to fix single frames using eg Clipclop or ReplaceFramesSimple. [If ClipClop, then SawBones might be useful]
[will also likely be slow-ish]

EDIT:
Code:
AviSource("D:\Parade.avi")

Global frame_number_with_good_colors = 128
good_frame= Trim(frame_number_with_good_colors,-1)                 # -1, NOT 1

# Apply MergeChroma for frames with bad chroma (AverageChromaU() < 120)
# Apply MergeChroma for frames in black and white (vPlaneMedian() = 127 or 128)

copy=Last
chromed=MergeChroma(clip, good_frame)

# Always way easier than all the Chr(13) stuff, [also, I dont like use of Chr(13), should be Chr(10) IMHO].
SSS = """
    v_median = vPlaneMedian()
    Result   = ((v_median==128 || v_median==127) || AverageChromaU < 120) ? 1 : 0
    Global frame_number_with_good_colors = (Result == 1) ? current_frame : frame_number_with_good_colors    # Will this do ?
#   (Result == 1) ? RT_WriteFile(".\variable.txt","%d",current_frame) : NOP                                 # I always find Writefile type stuff awkward, so dont/rarely use it [Not using Append=true]
    Return Result
"""

ConditionalSelect(Last, SSS , copy, chromed)
Clip = Last # if you need it in clip
Above untested at all.

EDIT: RT_WriteFile from RT_Stats.
If you want write list of frames to ".\variable.txt", Add Append=true, at end of RT_WriteFile( ... , Append=true)
EDIT: I tend to use "SSS" not because it is ending of my moniker, but means triple quoted string, "S" being single quoted string.
__________________
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 August 2020 at 15:03.
StainlessS is offline   Reply With Quote