Log in

View Full Version : NumCommandProcessor() v1.02 - 06 Apr 2019


StainlessS
6th April 2019, 02:38
Prompted by "Delete Lines In Image" Thread:- https://forum.doom9.org/showthread.php?t=176247

NumCommandProcessor_ReadMe.txt

# NumCommandProcessor_ReadMe.txt

# IMPORT Avsi files
NumCommandProcessor.avsi Command generator. https://forum.doom9.org/showthread.php?p=1870956#post1870956
PixelRemDup.avsi Pixel Row/Column Remove/Duplicate utility functions.
NumCommandUtility.avsi Utility functions, only MySub() at present, add your own.


# Client AVS files
NumCommandProcessor_DEMO.avs # Generator Demo Client.
NumCommand_LOG_DEMO.avs # Log Import and view result clip.

# Pre-Generated LOGFile, just all demo functions collected into single log file. Use NumCommand_LOG_DEMO.avs to Import and View clip.
MyLog.Log

ssS


NumCommandProcessor.avsi [Part 1 of 2]

# NumCommandProcessor.avsi

/*
NumCommandProcessor(), v1.02 by StainlessS @ Doom9 : https://forum.doom9.org/showthread.php?p=1870956#post1870956

Call some clip function with int command args taken from a Command String or File.
Can write/append generated commands to Logfile for further hand edit and frameserve with raw log commands and without NumCommandProcessor.

Required:-
RT_Stats v1.43+ [(c) StainlessS]
Avs+ [(c) Ultim, Pinterf & others], OR GScript [(c) Gavino].

NumCommandProcessor(clip c, String CMD,String CmdFunc,Int "NumMax"=c.Framecount-1,Int "NumMaxStep"=0,Bool "Reverse"=False,Bool "Debug"=True,String "LogFile"="",Bool "LogAppend") : returns result clip

Two modes of operation governed by CmdFunc string,

1 ) EMBEDDED single Number, eg "DeleteFrame(%d)" where Commands in CMD(String or File) must be single integer number only, no ranges allowed.
'%d' in above string is the insertion point for the integers read from CMD String or File.
If CmdFunc function is some kind of Delete or Insert function eg DeleteFrame or DuplicateFrame or RemovePixelRow or etc, then assuming the CMD string/file
integers are in ascending order, then should set Reverse=True, as when deleting/inserting something, higher number eg frames will move by 1 place due to the deleted/inserted frame/pixelRow.
In addition, if eg deleting frames, then should also set NumMaxStep=-1, to reduce the frame count so that validation check is decremented after each frame deleted.
If CmdFunc is some kind of Insertion function eg "DuplicateFrame(%d)" then should set NumMaxStep=1 as frame count will grow at every frame duplicate insertion.
If ANY kind of EMBEDDED non frame style function, eg "RemovePixelRow(%d)" then MUST set NumMax = c.Height-1 to validate cmd integers against height, and if eg
"RemovePixelColumn(%d)" then set NumMax = c.Width-1 (assuming that your clip is called c).

2 ) APPLYRANGE (NON-EMBEDDED), eg "Blur(1.58,1.58)" [NO insertion point ie no embedded '%d'].
In this mode, the CmdFunc is applied using ApplyRange with the numbers obtained from the CMD string/file (Can be single frame or range).

NEITHER of the above modes are of any use for trimming a clip, if you require command file for trimming ranges see
FrameSel Plugin (Especially SelectRanges.avs, which also requires Prune if trimming audio)
FrameSel:- https://forum.doom9.org/showthread.php?t=167971&highlight=FrameSel
Prune:- https://forum.doom9.org/showthread.php?t=162446
FrameSel SelectRanges.avs allows for Either Selecting or Rejecting command frames/ranges.

CMD, If First character is an Asterisk(*) then is interpreted as a multiline Command String of command numbers[one number/range per line], Otherwise a FileName of command numbers.
EMBEDDED mode allows only single Integers in CMD, whereas APPLYRANGE mode allows for 1 (frame) or 2 (range) on any command line.
Best if numbers/ranges in ascending order, and non overlapping ranges suggested (but not enforced).

CmdFunc, Function Name and optional positional insertion marker '%d' where the command number will be inserted, eg "DeleteFrame(%d)".
Do not include source clip, uses Last as in "DeleteFrame(%d)" or "Blur(1.58,1.58)".
See previously noted EMBEDDED and APPLYRANGE (NON-EMBEDDED) modes.
Do not use more than 1 insertion marker, it will produce error alert (there are no checks).

NumMax, Default c.FrameCount-1.
Maximum possible valid command number for validation, eg if "DeleteFrame(%d)" then use c.FrameCount-1, or for "RemovePixelRow(%d)" then c.Height-1,
For "RemovePixelColumn(%d)" use c.Width-1, etc (assuming that your clip is called c).
For APPLYRANGE (Non-EMBEDDED) mode, always set as as Default c.FrameCount-1.

NumMaxStep, Default 0. (Range: -1, or 0, or 1 ONLY)
Adjustment to NumMax validation check after some EMBEDDED mode delete or insert style CmdFunc,
eg use NumMaxStep=-1 for "DeleteFrame(%d)" or "RemovePixelRow(%d)" and NumMaxStep=1 for "DuplicateFrame(%d)" or "DuplicatePixelRow(%d)".
NOT USED in APPLYRANGE mode.

Reverse, Default False. If True, then Process CMD list of numbers in reverse order, from bottom of list to top, Else from top to bottom.
If eg Deleting or Inserting frames, then after each operation, all frames above would change their frame number, so must do in reverse order.
Probably does not really matter in APPLYRANGE mode unless ranges overlap (which they really should not).

Debug, Default True. Send Func calls to DebugView as each are called (Google DebugView) .

LogFile, Default "" ie No Log file. Give it a Filename to Produce log of commands used.

LogAppend, Default False. Only valid if LogFile!="". If True, then Append to existing Logfile, else Delete existing Logfile at Start.
LogFile and LogAppend, allow you to 'Collect' a bunch of generated commands for perhaps further hand edit, using NumCommandProcessor
just to generate a template with correct frames/ranges (including Reverse order if necessary, and validating ranges),
then make small adjustments eg Change Subtitle text or colors for one off adjustment.


Returns result clip after all commands executed, ALL processing of frames/ranges done before frame serving commences.

Eg >>>>>>>>>>>>>>>>>>>>>>>>>>>

Import(".\NumCommandProcessor.avsi")
Import(".\NumCommandUtility.avsi")
Import(".\PixelRemDup.avsi")

Colorbars(Width=1024,Height=768).KillAudio.ConvertToYV24.ShowFrameNumber

CMD="""* # <<<<<<<========== If 1st Character is Asterisk/Star ['*'] Then is a Command String, ELSE is a FileName.
100
200
300
400
500
"""
#CMD="CMD.txt" # Alternate use where numbers in File (same format)

RANGECMD="""* # <<<<<<<========== If 1st Character is Asterisk/Star ['*'] Then is a Command String, ELSE is a FileName.
100 149
200, 299
400
500 ,599
"""
#RANGECMD="RANGECMD.txt" # Alternate use where numbers in File (same format)


LOGFILE="MyLog.Log" # APPEND All to Log (Default="" ie not used)
LOGAPPEND=TRUE # APPEND All to Log (Default=FALSE, ie Delete LOG at start)

############################
## Pick One of below to Return, comment out others (Reverse assumes that CMD/RANGECMD are in ascending order)

## EMBEDDED mode frame Deletion / Insertion (Using CMD)
Return NumCommandProcessor(CMD,"DuplicateFrame(%d)",NumMaxStep=1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Insertion so REVERSE=True and NumMaxStep=1
#Return NumCommandProcessor(CMD,"DeleteFrame(%d)",NumMaxStep=-1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Deletion so REVERSE=True and NumMaxStep=-1

## APPLYRANGE modes (Using RNGCMD) NO Optional names allowed, and ALL (used) args in proper order (ApplyRange requirement).

#Return NumCommandProcessor(RANGECMD,"FlipVertical",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # APPLYRANGE, Accept Defaults, Frame or Range Commands
#Return NumCommandProcessor(RANGECMD,"FlipHorizontal",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info #
#Return NumCommandProcessor(RANGECMD,"Blur(1.58,1.58)",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info #
#Return NumCommandProcessor(RANGECMD,"Sharpen(1.0,1.0)",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info #
#Return NumCommandProcessor(RANGECMD,"Levels(24,1.2,220,16,235,false)",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # NO Optional names allowed, and in order.
#Return NumCommandProcessor(RANGECMD,"""MySub("Hello, World!","Ariel",64,$FF5555,$0,5)""",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # NO Optional names allowed, and in order.

## EMBEDDED pixel row/col Delete/Insert. (Using CMD)
## Assumes that you have RemovePixelRow, RemovePixelColumn, DuplicatePixelRow, and DuplicatePixelColumn script functions.

#Return NumCommandProcessor(CMD,"DuplicatePixelRow(%d)",NumMax=Height-1,NumMaxStep=1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Insertion so REVERSE=True and NumMaxStep=1
#Return NumCommandProcessor(CMD,"RemovePixelRow(%d)",NumMax=Height-1,NumMaxStep=-1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Deletion so REVERSE=True and NumMaxStep=-1
#Return NumCommandProcessor(CMD,"DuplicatePixelColumn(%d)",NumMax=Width-1,NumMaxStep=1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Insertion so REVERSE=True and NumMaxStep=1
#Return NumCommandProcessor(CMD,"RemovePixelColumn(%d)",NumMax=Width-1,NumMaxStep=-1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Deletion so REVERSE=True and NumMaxStep=-1

<<<<<<<<<<<<<<<<<<<<<<<<<<<
*/


Append next post (Copy/Paste)

Or find zip file @ MediaFire or SendSpace below this post.

StainlessS
6th April 2019, 02:39
NumCommandProcessor.avsi [Part 2 of 2]

Function NumCommandProcessor(clip c, String CMD,String CmdFunc,Int "NumMax",Int "NumMaxStep",Bool "Reverse",Bool "Debug",String "LogFile",Bool "LogAppend") { # https://forum.doom9.org/showthread.php?p=1870956#post1870956
Function ChrIsNul(String S) {return RT_Ord(S)== 0} # Chr(0), End Of String
Function ChrIsHash(String S) {return RT_Ord(S)==35} # #
Function ChrIsCParen(String S) {return RT_Ord(S)==41} # )
Function ChrIsStar(String S) {return RT_Ord(S)== 42} # *
Function ChrIsComma(String S) {return RT_Ord(S)==44} # ,
Function ChrIsDigit(String S) {C=RT_Ord(S) return C>=48&&C<=57} # 0123456789

myName="NumCommandProcessor: "
c
IsAvsPlus = (FindStr(VersionString, "AviSynth+")>0 || FindStr(VersionString, "AviSynth Neo")>0)
HasGScript=RT_FunctionExist("GScript")
NumMax=Default(NumMax,Framecount-1)
NumMaxStep=Default(NumMaxStep,0)
Reverse=Default(Reverse,False)
Debug=Default(Debug,True)
LogFile=Default(Logfile,"")
LogAppend=Default(LogAppend,false)
Assert(IsAvsPlus || HasGScript,RT_String("%sNeed either GScript or AVS+",myName))
Assert(CMD!="",RT_String("%sCMD cannot be ''",myName))
Assert(0 <= NumMax,RT_String("%s0 < NumMax(%d)",myName,NumMax))
Assert(-1 <= NumMaxStep <= 1,RT_String("%s-1 <= NumMaxStep(%d) <= 1",myName,NumMaxStep))
IsCmdFile = !CMD.ChrIsStar
CMD = (IsCmdFile) ? CMD.RT_GetFullPathName : CMD
Assert(!IsCmdFile || Exist(CMD),RT_String("%sCMD File does not exist\n'%s'",myName,CMD))
CMD = (IsCmdFile) ? CMD.RT_ReadTxtFromFile : CMD.MidStr(2)
HasLog=!LogFile.ChrIsNUL
LogFile=(HasLog) ? LogFile.RT_GetFullPathName : LogFile
(HasLog&&!LogAppend) ? RT_FileDelete(LogFile) : NOP # Delete logfile
Lines = RT_TxtQueryLines(CMD)
Line_Start = (Reverse) ? Lines-1 : 0
Line_End = (Reverse) ? 0 : Lines-1
Line_Step = (Reverse) ? -1 : 1
GS="""
Function ChrEatWhite(String S) {i=1 C=RT_Ord(S,i) While(C==32||C>=8&&C<=13) {i=i+1 C=RT_Ord(S,i)} return i>1?MidStr(S,i):S}
Function ChrEatDigits(String S) {i=1 C=RT_Ord(S,i) While(C>=48&&C<=57) {i=i+1 C=RT_Ord(S,i)} return i>1?MidStr(S,i):S}
CmdFunc=CmdFunc.ChrEatWhite.RevStr.ChrEatWhite.RevStr
FilterName=""
Cargs=""
IsEmbeddedNumber = (FindStr(CmdFunc,"%d")>0)
if(!IsEmbeddedNumber) {
OParenIx=FindStr(CmdFunc,"(")
if(OParenIx>1) {
Cargs=MidStr(CmdFunc,OParenIx+1).ChrEatWhite.RevStr.ChrEatWhite
if(Cargs.ChrIsCParen) { Cargs=Cargs.MidStr(2).ChrEatWhite }
Cargs=Cargs.RevStr
if(!Cargs.ChrIsNul) { Cargs="," + Cargs }
CmdFunc = LeftStr(CmdFunc,OParenIx-1)
CmdFunc=CmdFunc.RevStr.ChrEatWhite.RevStr
}

FilterName= Chr(34) + CmdFunc + Chr(34)
}
for(i=Line_Start, Line_End, Line_Step) {
SS=RT_TxtGetLine(CMD,i).ChrEatWhite
if(!SS.ChrIsNul && !SS.ChrIsHash) {
S=SS
if(S.ChrIsDigit) {
Number1 = S.RT_NumberValue
Assert(0 <= Number1 <= NumMax,RT_String("%sError@Line_%d, 0 <= Number(%d) <= NumMax(%d)\n'%s'",myName,i+1,Number1,NumMax,SS))
S=S.ChrEatDigits.ChrEatWhite
Number2=Number1
HasComma=S.ChrIsComma
if(HasComma) { S=S.MidStr(2).ChrEatWhite }
if(S.ChrIsDigit) {
Number2 = S.RT_NumberValue
Assert(Number1 <= Number2 <= NumMax,RT_String("%sError@Line_%d, Number1(%d) <= Number2(%d) <= NumMax(%d)\n'%s'",myName,i+1,Number1,Number2,NumMax,SS))
S=S.ChrEatDigits.ChrEatWhite
} else if(HasComma) {
Assert(False,RT_String("%sError@Line_%d, Expecting 2nd Number after comma\n'%s'",myName,i+1,SS))
}
if(IsEmbeddedNumber) {
Assert(Number1==Number2,RT_String("%sError@Line_%d, Number1=%d Number2=%d : Can Only Embed single number not Range\n'%s'",myName,i+1,Number1,Number2,SS))
Func=RT_String(CmdFunc,Number1)
(Debug) ? RT_DebugF("Calling Embedded Number Func '%s'",Func,name=myName) : NOP
(HasLog) ? RT_WriteFile(LogFile,"%s",Func,Append=True) : NOP
Last=Eval(Func)
NumMax = NumMax + NumMaxStep
Assert(0 <= NumMax,RT_String("%sError@Line_%d, 0 <= NumMax(%d)\n'%s'",myName,i+1,NumMax,SS))
} else {
ARS=RT_String("ApplyRange(%d,%d,%s%s)",Number1,Number2,FilterName,Cargs)
(Debug) ? RT_DebugF("Calling '%s'",ARS,name=myName) : NOP
(HasLog) ? RT_WriteFile(LogFile,"%s",ARS,Append=True) : NOP
Last=Eval(ARS)
}
}
Assert(S.ChrIsHash || S.ChrIsNul,RT_String("%sError@Line_%d, *** NON-PARSE ***\n'%s'",myName,i+1,SS))
}
}
"""
HasGScript ? GScript(GS) : Eval(GS) # Use GScript if installed (loaded plugs override builtin)
return Last
}

StainlessS
6th April 2019, 02:40
PixelRemDup.avsi : Used in demo

# PixelRemDup.avsi : https://forum.doom9.org/showthread.php?p=1870958#post1870958

# Remove or Duplicate Pixel Rows or columns from clip, NOT YV12, must be able to crop on any boundary eg YV24 or RGB.

Function RemovePixelRow(clip c,Int Row) { # Remove Clip Pixel Row
c
Assert( 0 <= Row < c.Height,string(Row,"RemovePixelRow: Invalid Row number(%.0f)"))
Return (Row==0) ? Crop(0,1,0,0)
\ : (Row==Height-1) ? Crop(0,0,0,Row)
\ : StackVertical(Crop(0,0,0,Row),Crop(0,Row+1,0,0))
}

Function RemovePixelColumn(clip c,Int Column) { # Remove Clip Pixel Column
c
Assert( 0 <= Column < c.Width,string(Column,"RemovePixelColumn: Invalid Column number(%.0f)"))
Return (Column==0) ? Crop(1,0,0,0)
\ : (Column==Width-1) ? Crop(0,0,Column,0)
\ : StackHorizontal(Crop(0,0,Column,0),Crop(Column+1,0,0,0))
}

Function DuplicatePixelRow(clip c,Int Row) { # Duplicate Clip Pixel Row
c
Assert( 0 <= Row < c.Height,string(Row,"DuplicatePixelRow: Invalid Row number(%.0f)"))
Return (Row==0) ? StackVertical(Crop(0,0,0,1),Crop(0,0,0,0))
\ : (Row==Height-1) ? StackVertical(Crop(0,0,0,0),Crop(0,Height-1,0,1))
\ : StackVertical(Crop(0,0,0,Row+1),Crop(0,Row,0,0))
}

Function DuplicatePixelColumn(clip c,Int Column) { # Duplicate Clip Pixel Column
c
Assert( 0 <= Column < c.Width,string(Column,"DuplicatePixelColumn: Invalid Column number(%.0f)"))
Return (Column==0) ? StackHorizontal(Crop(0,0,1,0),Crop(0,0,0,0))
\ : (Column==Width-1) ? StackHorizontal(Crop(0,0,0,0),Crop(0,Width-1,1,0))
\ : StackHorizontal(Crop(0,0,Column+1,0),Crop(Column,0,0,0))
}


NumCommandUtility.avsi

# NumCommandUtility.avsi
###########
### UTILITY Demo Functions

Function MySub(clip c,String Text,String Font,Float Size,Int Text_Color,Halo_Color,Int Align) {
Return c.Subtitle(text,font=Font,size=Size,text_color=Text_Color,halo_color=Halo_Color,align=Align)
}

StainlessS
6th April 2019, 02:41
DEMO Generator Client : NumCommandProcessor_DEMO.avs

# NumCommandProcessor_DEMO.avs : https://forum.doom9.org/showthread.php?p=1870959#post1870959

Import(".\NumCommandProcessor.avsi")
Import(".\NumCommandUtility.avsi")
Import(".\PixelRemDup.avsi")

Colorbars(Width=1024,Height=768).KillAudio.ConvertToYV24.ShowFrameNumber

CMD="""* # <<<<<<<========== If 1st Character is Asterisk/Star ['*'] Then is a Command String, ELSE is a FileName.
100
200
300
400
500
"""
#CMD="CMD.txt" # Alternate use where numbers in File (same format)

RANGECMD="""* # <<<<<<<========== If 1st Character is Asterisk/Star ['*'] Then is a Command String, ELSE is a FileName.
100 149
200, 299
400
500 ,599
"""
#RANGECMD="RANGECMD.txt" # Alternate use where numbers in File (same format)


LOGFILE="MyLog.Log" # APPEND All to Log (Default="" ie not used)
LOGAPPEND=TRUE # APPEND All to Log (Default=FALSE, ie Delete LOG at start)

############################
## Pick One of below to Return, comment out others (Reverse assumes that CMD/RANGECMD are in ascending order)

## EMBEDDED mode frame Deletion / Insertion (Using CMD)
Return NumCommandProcessor(CMD,"DuplicateFrame(%d)",NumMaxStep=1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Insertion so REVERSE=True and NumMaxStep=1
#Return NumCommandProcessor(CMD,"DeleteFrame(%d)",NumMaxStep=-1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Deletion so REVERSE=True and NumMaxStep=-1

## APPLYRANGE modes (Using RNGCMD) NO Optional names allowed, and ALL (used) args in proper order (ApplyRange requirement).

#Return NumCommandProcessor(RANGECMD,"FlipVertical",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # APPLYRANGE, Accept Defaults, Frame or Range Commands
#Return NumCommandProcessor(RANGECMD,"FlipHorizontal",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info #
#Return NumCommandProcessor(RANGECMD,"Blur(1.58,1.58)",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info #
#Return NumCommandProcessor(RANGECMD,"Sharpen(1.0,1.0)",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info #
#Return NumCommandProcessor(RANGECMD,"Levels(24,1.2,220,16,235,false)",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # NO Optional names allowed, and in order.
#Return NumCommandProcessor(RANGECMD,"""MySub("Hello, World!","Ariel",64,$FF5555,$0,5)""",LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # NO Optional names allowed, and in order.

## EMBEDDED pixel row/col Delete/Insert. (Using CMD)
## Assumes that you have RemovePixelRow, RemovePixelColumn, DuplicatePixelRow, and DuplicatePixelColumn script functions.

#Return NumCommandProcessor(CMD,"DuplicatePixelRow(%d)",NumMax=Height-1,NumMaxStep=1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Insertion so REVERSE=True and NumMaxStep=1
#Return NumCommandProcessor(CMD,"RemovePixelRow(%d)",NumMax=Height-1,NumMaxStep=-1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Deletion so REVERSE=True and NumMaxStep=-1
#Return NumCommandProcessor(CMD,"DuplicatePixelColumn(%d)",NumMax=Width-1,NumMaxStep=1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Insertion so REVERSE=True and NumMaxStep=1
#Return NumCommandProcessor(CMD,"RemovePixelColumn(%d)",NumMax=Width-1,NumMaxStep=-1,Reverse=True,LogFile=LOGFILE,LogAppend=LOGAPPEND).Info # Embedded, Deletion so REVERSE=True and NumMaxStep=-1

StainlessS
6th April 2019, 09:22
NumCommand_LOG_DEMO.avs

# NumCommand_LOG_DEMO.avs : Create LogFile first.

LogFile=".\MyLog.Log"
#################
Colorbars(Width=1024,Height=768).KillAudio.ConvertToYV24.ShowFrameNumber # SAME source as for NumCommandProcessor.avs
#################
Import(".\NumCommandUtility.avsi")
Import(".\PixelRemDup.avsi")
Import(LogFile)

Return Last #.Info


MyLog.Log : # Pre-Generated LOGFile, just all demo functions collected into single log file. Use NumCommand_LOG_DEMO.avs to Import and View clip.
# Loaded by above DEMO file, and plays : Dont expect anything too clever, Duplicates and Deletes same frames etc.

DuplicateFrame(500)
DuplicateFrame(400)
DuplicateFrame(300)
DuplicateFrame(200)
DuplicateFrame(100)
DeleteFrame(500)
DeleteFrame(400)
DeleteFrame(300)
DeleteFrame(200)
DeleteFrame(100)
ApplyRange(100,149,"FlipVertical")
ApplyRange(200,299,"FlipVertical")
ApplyRange(400,400,"FlipVertical")
ApplyRange(500,599,"FlipVertical")
ApplyRange(100,149,"FlipHorizontal")
ApplyRange(200,299,"FlipHorizontal")
ApplyRange(400,400,"FlipHorizontal")
ApplyRange(500,599,"FlipHorizontal")
ApplyRange(100,149,"Blur",1.58,1.58)
ApplyRange(200,299,"Blur",1.58,1.58)
ApplyRange(400,400,"Blur",1.58,1.58)
ApplyRange(500,599,"Blur",1.58,1.58)
ApplyRange(100,149,"Sharpen",1.0,1.0)
ApplyRange(200,299,"Sharpen",1.0,1.0)
ApplyRange(400,400,"Sharpen",1.0,1.0)
ApplyRange(500,599,"Sharpen",1.0,1.0)
ApplyRange(100,149,"Levels",24,1.2,220,16,235,false)
ApplyRange(200,299,"Levels",24,1.2,220,16,235,false)
ApplyRange(400,400,"Levels",24,1.2,220,16,235,false)
ApplyRange(500,599,"Levels",24,1.2,220,16,235,false)
ApplyRange(100,149,"MySub","Hello, World!","Ariel",64,$FF5555,$0,5)
ApplyRange(200,299,"MySub","Hello, World!","Ariel",64,$FF5555,$0,5)
ApplyRange(400,400,"MySub","Hello, World!","Ariel",64,$FF5555,$0,5)
ApplyRange(500,599,"MySub","Hello, World!","Ariel",64,$FF5555,$0,5)
DuplicatePixelRow(500)
DuplicatePixelRow(400)
DuplicatePixelRow(300)
DuplicatePixelRow(200)
DuplicatePixelRow(100)
RemovePixelRow(500)
RemovePixelRow(400)
RemovePixelRow(300)
RemovePixelRow(200)
RemovePixelRow(100)
DuplicatePixelColumn(500)
DuplicatePixelColumn(400)
DuplicatePixelColumn(300)
DuplicatePixelColumn(200)
DuplicatePixelColumn(100)
RemovePixelColumn(500)
RemovePixelColumn(400)
RemovePixelColumn(300)
RemovePixelColumn(200)
RemovePixelColumn(100)

StainlessS
6th April 2019, 09:24
v1.02, Added LogFile and LogAppend args.


LogFile, Default "" ie No Log file. Give it a Filename to Produce log of commands used.

LogAppend, Default False. Only valid if LogFile!="". If True, then Append to existing Logfile, else Delete existing Logfile at Start.
LogFile and LogAppend, allow you to 'Collect' a bunch of generated commands for perhaps further hand edit, using NumCommandProcessor
just to generate a template with correct frames/ranges (including Reverse order if necessary, and validating ranges),
then make small adjustments eg Change Subtitle text or colors for one off adjustment.