View Single Post
Old 31st August 2017, 03:47   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Oops, a few corrections, re-upped zip (only had 1 download, no version bump).

Post #2 correction (Final was originally another name, and default True, forgot to invert some True's to False and False to True)
Code:
Final Default False,       If False, then DOES NOT Delete any ranges, replace only. Delete Operations only occur if this arg is True.
                             Set False, when using SawBones together with NotePad and VirtualDubFilterMod (with Script Editor Window Open).
                             When False, will not do deletions, will instead show frames marked with "DUMMY DELETE" in frame center.
                             Purpose, to avoid editing errors using SawBones v1.04 "Save & Refresh" AVS, keyboard command. (Not a
                             good idea to edit clip where deletions have already been done, ie edits after first deletion, would all be wrong).
                             Change to FINAL=True, when all edits including deletions are complete, where real deletions will ensue.
                             If later adding some edits to a command file using SawBones, then set FINAL=False until editing complete.

Post #3 correction (was "SplitCommands: ")
Code:
myName="FrameSurgeonSplitCommands: "
Post #4 correction (somehow got changed back to $KEY_CTRL_SHIFT_ALT & "?", would still work same (at least on my keyboard)
Code:
Global $USER_KEY_InterpRange=$KEY_CTRL_SHIFT_ALT & "/"  ; User can choose a suitable key for Interpolate Range (default "?")
# EDIT: Above, Damn, should be changed in comment too
Posts 2, 3 and 4 corrected.

EDIT: In re-upped zip, also made this amendment to FrameSurgeon_DEMO.avs (show STACK 6 windows, with FX1->FX4, was only FX1->FX2)
Code:
Import("../FrameSurgeon.avs")

### Config #############################################
FINAL=False                 # Change to TRUE to do real DELETES (FALSE only shows where deletes would occur, ALWAYS use FALSE with SawBones)
### One of below strings
SCMD="""                 # Demo Test
    CP  100              # CP, Single frame args ONLY. Replace 100 with frame 99.
    CN  101              # CN, Single frame args ONLY. REplace 101 with frame 102.
    I9  110              # Id, Single frame args ONLY. Interpolate 9 frames starting at frame 110.
    FX1 200,299          # Replace 200->299 with same range from FX1 clip. (FXd clips default source if not supplied, Subtitled if Show)
    FX2 300,399
    FX3 400,499
    FX4 500,-50          # Replace 50 frames starting at 500.
    FX5 550,-50          # Replace 50 frames starting at 550. NOTE, as not defined in this script FX5 defaults Subtitled source clip.
    FX6 600,-100         # Replace 100 frames starting at 600. NOTE, as not defined in this script FX6 defaults Subtitled source clip.
    FX7 700,-100         # Replace 100 frames starting at 700. NOTE, as not defined in this script FX7 defaults Subtitled source clip.
    DEL 800,899
    DEL 900,-100         # Del 100 frames starting from 900
    DEL 2000,0           # Del from 2000 to end of clip.
"""
#SCMD=""

### One of below strings (CMD file is processed before SCMD, where multiple replacements on same frame)
CMD="FrameSurgeon_DEMO_Cmd.TXT" # Command file, perhaps created via SawBones.
#CMD = ""

SHOW=!FINAL                 # Show ClipClop OR Prune Metrics
SHOWMODE=0                  # 0=ClipClop metrics, 1=Prune Metrics (Show remaining after deletions rather than replacements)
DV=4                        # 0=ERRORS ONLY, 4=FULL Debug to DebugView(Google)
NOERR=False                 # Set True if wanting to IGNORE FXd commands for undefined FXd clips.

# MvTools, Interpolate args (see mvTools)
PEL=2
SHARP=2
RFILTER=2
ML=100.0
#
STACK=(!FINAL || SHOW)          # Auto stack window OFF when FINAL==True and SHOW==FALSE
########################################################

### Source clip ###
src=Colorbars.killaudio.ConvertToYV12
src=src.ShowFrameNumber(Size=src.Height/6,x=src.Width/2,y=src.Height/3)

### Simulated replacement clips ###
FX1 = src.FlipVertical
FX2 = src.FlipHorizontal
FX3 = src.Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58)
FX4 = src.Sharpen(1.0).Sharpen(1.0).Sharpen(1.0)

### Edit or No Edit ###
CMD=(CMD!="") ? RT_GetFullPathName(CMD) : ""
PROCESS = (SCMD!="" || (CMD!="" && Exist(CMD)))     # Skip FrameSurgeon if no String nor file commands (yet).

Result = (PROCESS)
        \ ? FrameSurgeon(src,scmd=SCMD,cmd=CMD,Show=Show,ShowMode=SHOWMODE,dv=DV,
        \   fx1=FX1,fx2=FX2,fx3=FX3,fx4=FX4,
        \   pel=PEL,sharp=SHARP,rfilter=RFILTER,ml=ML,
        \   Final=FINAL,NoErr=NOERR)
        \ : src

### Stack For View ###
BSZ=4 BCOL=$FF00FF
Ssrc=src.RtSub("Source",True)   SFX1=FX1.RtSub("FX1",True)  SFX2=FX2.RtSub("FX2",True)
SFX3=FX3.RtSub("FX3",True)      SFX4=FX4.RtSub("FX4",True)  SResult=Result.RtSub("Result",True)
TOP=StackHorizontal(Ssrc,Ssrc.BlankClip(width=BSZ,Color=BCOL),SFX1,Ssrc.BlankClip(width=BSZ,Color=BCOL),SFX2)
BOT=StackHorizontal(SFX3,Ssrc.BlankClip(width=BSZ,Color=BCOL),SFX4,Ssrc.BlankClip(width=BSZ,Color=BCOL),SResult)
Return (STACK) ? StackVertical(TOP,TOP.BlankClip(height=BSZ,Color=BCOL),BOT) : Result

# Stack Overhead RT_Subtitle Text, with optional FrameNumber shown.
Function RtSub(clip c,string Tit, Bool "ShowFrameNo") {
    c.BlankClip(height=20)
    (Default(ShowFrameNo,False)) ? ScriptClip("""RT_Subtitle("%d] %s",current_frame,""""+Tit+"""")""") : RT_Subtitle("%s",Tit)
    Return StackVertical(c).AudioDubEx(c)
}

Return Last
EDIT: DAMN, default in FrameSurgeon for Final should be false, but its true. (EDIT: Or should stay true, hard to decide)
__________________
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; 1st September 2017 at 09:20.
StainlessS is offline   Reply With Quote