View Single Post
Old 27th July 2021, 21:59   #85  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Coolgit,
maybe of use [I've used my GeneralConvolution thingy as fixed clip, but could use some other de-streak'ed clip].

Code:
/*
    Requires Avs+, FrameSel[v2.21 just posted new version], ClipClop, RT_Stats
    Frames file specifies frames/ranges to fix.
*/

Avisource("SH_2_secs.avi.avi")
STACK = false                        # True, result is STACKED, else Not
SHOW  = True                         # True, Show ClipClop metrics, else Not
Frames = ".\Frames.txt"              # Frames/Ranges to fix, file, either single frame number or range eg 100,110 or 100 110.
###
Frames = Frames.RT_GetFullPathName
###
ConvertToYV24
O=Last

# We're gonna use GeneralConvolution de-streaker whotsit, is applied to ENTIRE clip.
De_Streak = GeneralConvolution(0, "
1 0 1
2 4 2
1 0 1
")

FixFrames(O,De_Streak,Frames,Show=SHOW)  # Replace frames/ranges in frames file with De_Streaked frames

###
STK = StackHorizontal(O,Last) # Lft=Original, Rgt=Fixed
#STK = StackVertical(O,Last)  # Top=Original, Bot=Fixed ## If Preferred

(STACK) ? STK : Last
ConvertToYV12
Return last

Function FixFrames(clip c,clip repc,string Frames,Bool "Show") {
    Show = Default(Show,False)
    Assert(Frames!="","FixFrames: Frames cannot be ''")
    Frames = Frames.RT_GetFullPathName
    Assert(Frames.Exist,"FixFrames: Frames file Does Not Exist")
    # Temp filename for Frames file re-written as ClipClop Command file [with clip index of 1 for replacement clip].
    ClipClopCmd=(".\~ClipClipCmd_" + RT_LocalTimeString(file=True) + ".Txt").RT_GetFullPathName
    # Convert To ClipClop Cmd file, REQUIRES FrameSel v2.21 for PruneIx arg and ClipClop clip_index=1 conversion.
    FrameSel_CmdReWrite(c,ClipClopCmd,cmd=Frames,Ordered=true,range=true,Prune=True,PruneIx=1)
    ClipClop(c,repc,Cmd=ClipClopCmd,show=SHOW)
    RT_FileDelete(ClipClopCmd)    # Done with it.
    return Last
}
EDITED: OOps, added in blue. RT_FileDelete(ClipClopCmd)

EDIT:
Contents of Frames file [Frames.txt] to fix frame 5, and range 10 to 20, and range 30 to 40
Code:
5
10,20
30,40
EDIT: 5; 10,20; and 30,40 picked out of the hat, use your own numbers.
__________________
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 July 2021 at 22:27.
StainlessS is offline   Reply With Quote