View Single Post
Old 28th August 2017, 23:28   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
SawBones(FrameSurgeon) v1.03 - 28 Aug 2017, new version, see 1st post.

Sawbones no change but version bump to v1.03 to match FrameSurgeon.avs.

FrameSurgeon.avs, versioned at v1.03.
Now errors if you attempt to give ClipClop clip index instead of command mnemonic (eg requires CP n, means CopyFromPrevious frame n-1 to frame n).
Just a bit safer (less likely user mishaps) to disable direct clip index use.

Added optional 'I n' and 'I s,e' commands (ie can specify frame/range separate from command, eg 'I 101,103' instead of 'I3 101'), in blue below
(still limited to max interpolation of 9 frames).
Code:
        "I1  n"        Interpolate 1 frame n (using source frames n-1 and n+1 as Interpolation source frames, (Id commands Planar, YUY2 only).
        "I2  n"        Interpolate 2 frames starting at frame n, (using source frames n-1 and n+2).
        "I3  n"        Interpolate 3 frames starting at frame n, (using source frames n-1 and n+3).
        "I4  n"        Interpolate 4 frames starting at frame n, (using source frames n-1 and n+4).
        "I5  n"        Interpolate 5 frames starting at frame n, (using source frames n-1 and n+5).
        "I6  n"        Interpolate 6 frames starting at frame n, (using source frames n-1 and n+6).
        "I7  n"        Interpolate 7 frames starting at frame n, (using source frames n-1 and n+7).
        "I8  n"        Interpolate 8 frames starting at frame n, (using source frames n-1 and n+8).
        "I9  n"        Interpolate 9 frames starting at frame n, (using source frames n-1 and n+9).
        "I   n"        Interpolate 1 frame n (using source frames n-1 and n+1 as Interpolation source frames.
        "I   s,e"      Interpolate range s to e (max range 9 frames, using source frames s-1 and e+1 as source frames).
Added, FrameSurgeon_DEMO.avs
Code:
Import("FrameSurgeon.avs")

### Config ###
SHOW=True                                           # Show ClipClop OR Prune Metrics
SHOWMODE=0                                          # 0=ClipClop metrics, 1=Prune Metrics (Show deletions rather than replacements)
SCMD=""                                             # Not Using SCMD in this DEMO
CMD="DEMO_Command.txt"
DV=5                                                # 0=ERRORS ONLY, 5=FULL Debug to DebugView(Google)
STACK=True

### Source clip and Simulated replacement clips ###
src=Colorbars.killaudio.ConvertToYV12.ShowFrameNumber(Size=72,x=320,y=240)
FX1=src.FlipHorizontal              # Light denoising or whatver
FX2=FX1.FlipVertical                # Heavy denoising or whatver

### Edit or No Edit ###
CMD=(CMD!="") ? RT_GetFullPathName(CMD) : ""
PROCESS = (SCMD!="" || (CMD!="" && Exist(CMD)))     # Skip FrameSurgeon if no String nor file commands.
Result = (PROCESS) ? FrameSurgeon(src,scmd=SCMD,cmd=CMD,Show=Show,ShowMode=SHOWMODE,dv=DV,fx1=FX1,fx2=FX2) : src

### Stack For View ###
TOP=StackHorizontal(src.RtSub("Source",True),FX1.RtSub("FX1",True))
BOT=StackHorizontal(FX2.RtSub("FX2",True),Result.RtSub("Result",True))
Return (STACK) ? StackVertical(TOP,BOT) : Result


/*
    Can use above script where DEMO_Command.txt file does not exist and will not produce error, ie use same script and Demo_Command.txt
    with VirtualDub, Sawbones, and NotePad.
*/
DEMO_Command.txt
Code:
DEL 400,449    # Delete frames 400 to 449 (AFTER ALL replacments done)
I3  10         # Interp frames 10 -> 12, using 9 and 13 as source
I9  20	       # Interp frames 20 -> 28, using 19 and 29 as source  # EDIT: or I 20,28
CP  30         # Replace frame 30 with frame 29
CN  31         # Replace frame 31 with frame 32
FX1 50,199     # replace range 50,199 with same range from FX1 clip
DEL 1000,-1000 # Delete frames 1000 to 1999 (AFTER ALL replacments done) # EDIT: Added
FX2 300,599    # replace range 300,599 with same range from FX2 clip
EDIT: FrameSurgeon.avs, Changed IsYV12 colorspace detection to IsPlanar detection, allow use with mvtools
that support other planar colorspaces, will error if YUY2 and mvtools version does not support it.
EDIT: -ve frame end (frame count) NOT supported for Range interpolation ie 'I 100,-9' will fail (guess I might implement if required).
EDIT: Note, frame/range deletes have a 1ms linear FadeOut/FadeIn at splices simulating zero crossing, to prevent 'Cracks' in audio.
__________________
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; 29th August 2017 at 01:00.
StainlessS is offline   Reply With Quote