View Single Post
Old 19th June 2017, 20:53   #393  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Doomwake,

Have been struggling with how best to answer your post.
All of the plugins/scripts you mentioned, do not do what you presume that they do.
The de-logo script (S_ExLogo), only blurs out the area that you tell it to blur, it does no logo detection at all.
FrameRep, replaces frames back into same position that they were originally gotten from, using the same frames command file.
SecurityCamExtractMotion script is nothing whatever to do with what you want.

If the SirPlant script is not working, then (most likely) either args were not best set, or the clips were not in sync.
I would suggest that your only option is to edit manually (replacing the frames that were probably deemed 'Out Of Sync' by SirPlant.
(I have no idea how many, nor whether runs of frames or single frames were skipped).
SirPlant with Strict=False, already allows for every 2nd frame in a sequence to be up to 1 frame out of sync, if editing by hand you would
need to decide how to deal with out of sync frames yourself, and keep in mind that audio will likely end up out of sync if not careful.

Save result clip from SirPlant_Slice.avs (SRC_AUDIO=False, if Strict==False).
Save result clip from SirPlant_ShowNonReplaced.avs, (Frames from replace clip that were not inserted into src clip).

You need to save audio somehow (maybe just to a variable and then audioDub back again later), and simply use trim and splice in hand edit.

Some suggestions for worst case scenario settings

Code:
# SirPlant_Client.avs

Import("SirPlant.avs")

srcFN    = "S2.avi"                # Source clip
repFN    = "S1.AVI"                # Replace clip, Holds sequences that will replace those in source clip.
                                   # Sequences in Replace clip should be in SAME order as in source clip.
                                   # Clips must be same size, colorspace.
                                   # When splicing sequences with Prune (later) everything must be similar, audio etc,
                                   # also audio should both be normalized for similar voume levels, this detection stage ignores audio.
                                   # In later script, Prune will replace with both video and audio from replace clip.
srcARR      = SRCFN+".ARR"         # Name of RT_QwikScan FingerPrint Array
srcNxtARR   = SRCFN+".Next.ARR"    # Name of RT_QwikScan Locator Next Array (Next == scan forward Array)
repARR      = REPFN+".ARR"         # Name of RT_QwikScan FingerPrint Array
repNxtARR   = REPFN+".Next.ARR"    # Name of RT_QwikScan Locator Next Array (Next == scan forward Array)
#
src         = AVISource(srcFN)
rep         = AVISource(repFN)
#
Th          = 0.8                  # Default 0.9(not close matching frames maybe about 0.8)
Th2         = 0.65                 # Default 0.75(not close matching frames maybe about 0.65)
LUMATOL     = 12.0                 # Default 8.0(not close matching frames maybe up to about 16.0)
MatchLen    = 32                   # Default 60(Minimum sequence length that must match (frames). Default 60(not close matching frames maybe about 32)
SEARCHSTEP  = 4                    # Default MatchLen/4(not close matching frames maybe about 4) Frames to step after match failure.
STRICT      = False                # Default True=strict 1:1 matching of frames, False=allow slight mismatch ie missing/extra frames in replacement clip.
VERBOSITY   = 5                    # Debug output verbocity level, to DebugView.
INSMODE     = 0                    # Default 0=Replace Only, 1=Insert Extras Only, 2=Replace and Insert Extras
BLKW        = 64                   # default 64
BLKH        = 64                   # default BLKW
OLAPX       = 0                    # default BLKW/2
OLAPY       = 0                    # default BLKH/2

X           =  4                   # Avoid edge noise or logos. (All default 0)
Y           =  4
W           = -4
H           = -4                   

### !!! MUST SET TRUE FIRST, THEN FALSE to RUN !!! ###
CREATE      = False               # Set True to Create QWikScan arrays for SirPlant. (View progress in DebugView)

(CREATE) ? RT_QwikScanCreate(Src,srcARR,"",srcNxtARR,debug=true,x=X,y=Y,w=W,h=H) : NOP  # Only need create these once, Re-Create if change coords or clips.
(CREATE) ? RT_QwikScanCreate(rep,RepARR,"",repNxtARR,debug=true,x=X,y=Y,w=W,h=H) : NOP

### !!! USE DEBUGVIEW !!! ###
(!CREATE) ? SirPlant(src,rep,srcARR,srcNxtARR,repARR,repNxtARR,
                \ Th=Th,Th2=Th2,MatchLen=MatchLen,SearchStep=SEARCHSTEP,LumaTol=LUMATOL,Strict=STRICT,InsMode=INSMODE,VerBosity=VERBOSITY,
                \ Blkw=BLKW,BlkH=BLKH,OLapX=-OLAPX,OLapY=OLAPY
                \ ) : NOP

return Messageclip("All Done")
You would need set X,Y,W,H coords for logo avoidance, or crop off during detect stage.


Code:
# SirPlant_Splice.avs

vSrc="S2.avi"
vRep="S1.avi"

#
Project="Default"
Cmd=Project+"_Command.txt"
SHOW        = True
SRC_AUDIO   = False         # Use only Source audio. ONLY if STRICT and not inserting EXTRA replacement ranges, else out of sync audio likely
                            # Use SRC_AUDIO = True, Only if STRICT==TRUE at detector stage.
                            
STACK       = False         # Same for STACK, only True if Strict and no EXTRA replacement ranges.

NORM=(!SHOW && !STACK && !SRC_AUDIO)


A=AVISource(vSrc)
D=AVISource(vRep)

A = (NORM) ? A.Normalize : A
D = (NORM) ? D.Normalize : D

B=A     C=A
E=D     F=D

A = (SHOW) ? A.AddBorders(0,0,0,16,$000000) : A
B = (SHOW) ? B.AddBorders(0,0,0,16,$404040) : B
C = (SHOW) ? C.AddBorders(0,0,0,16,$808080) : C
D = (SHOW) ? D.AddBorders(0,0,0,16,$00FF00) : D
E = (SHOW) ? E.AddBorders(0,0,0,16,$FF0000) : E
F = (SHOW) ? F.AddBorders(0,0,0,16,$0000FF) : F

SrcAudio=A.KillVideo

Nicks="""
    InterveningSource=0
    MatchingSource=1
    EndRangeSource=2
    MatchingReplacement=3
    ExtraReplacement=4
    EndRangeReplacement=5
"""


Prune(A,B,C,D,E,F,cmd=Cmd,NickName=Nicks,Show=SHOW)

(SRC_AUDIO) ? AudioDub(SrcAudio) : NOP

return (STACK) ? StackVertical(A,Last) : Last

Code:
# SirPlant_ShowNonReplaced.avs

repFN="s1.AVI"

Project="Default"

Cmd=Project+"_UnUsed.txt"

A=AVISource(repFN)

Nicks="""
    ShortRangeLessThanMinReplace=0
    SkippedExtras=1
"""
SHOW=True

Prune(A,A,cmd=Cmd,NickName=Nicks,Show=SHOW)
Good luck

EDIT: You could lower Th, Th2 and MatchLen even lower than suggested, but there is a small chance that the Moon could crash into the Earth tomorrow afternoon, if you do.

EDIT: Examining logs could tell you why frames were not replaced. (DebugView with Verbosity=5, is most comprehensive)
__________________
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; 19th June 2017 at 21:29.
StainlessS is offline   Reply With Quote