Log in

View Full Version : ClipClop v1.26 - Range/Frame Replacement plug - 22 Dec 2018


StainlessS
17th August 2011, 20:56
Docs in brief (full docs see post #38:- https://forum.doom9.org/showthread.php?p=1860800#post1860800 )

ClipClop() Range/Frame Replacement Plugins for Avisynth v2.58, v2.60 avs+ x86 & x64 by StainlessS.

Video:- Planar, YUY2, RGB32, RGB24. v2.60 dll all Valid Colorspaces incl HBD where Avs+.

Does NOT affect Audio (as source clip).

Clipclop is a simple plugin to replace ranges in a source clip with the same range, from a replacement clip.
Supports up to 255 replacement clips, with unlimited number of replacements into output clip.

ClipClop(clip source, clip R1, ... , clip R255, string 'Cmd',string 'SCmd', bool 'Show', bool 'Ver',int 'dv', bool 'NoErr',string "Nickname",bool "Purge")

Compulsory args:

Source, clip, No default [AKA (also known as) R0 in commands].

Rx, clip, No Default
Replacement clips, at least one required,
The first clip R1, up to R255 are supported, 255 clips in all.

Optional args:

Cmd, string, Default= "", Not set.
Command file, use eg "Clop.txt" for command file in your *.avs script directory.

SCmd, string, Default= "", Not set.
Command String, as for command file, but commands supplied in a string rather than a file.

Show bool, Default= false.
true = Show info. v2.6 plugin only required for Show or Ver args with v2.6 colorspace.

ver bool, Default=false.
true = Show version. v2.6 plugin only required for Show or Ver args with v2.6 colorspace.

dv int, Default 0, possible values, 0 - 4 (Out of range values will default to 4==Debug==FULL)
Generates info/warning/error messages during the filter setup stage (before 1st frame is displayed).

0 = No info
1 = Errors sent to DebugView window (Need DebugView Utility)
2 = Warnings & Errors sent to DebugView window
3 = Parsing Info, Warnings & Errors sent to DebugView window.
4 = Debug info, Parsing Info, Warnings & Errors sent to DebugView window (dll Testing, or just for your curiosity).

In DebugView, filter for "ClipClop:" to skip all the extraneous stuff generated by other plugins/programs.
(On "Menu:Edit-Filter/Highlight", and enter "ClipClop:", all ClipClop messages are prefixed by "ClipClop:".

http://technet.microsoft.com/en-gb/sysinternals/bb545027

NoErr, bool, Default false

false = Stop on ANY command error. (usual mode)
You will be informed in DebugView which (if any) errors can be ignored if switched to NoErr==true.

true = Suppress trivial errors where possible.
Only use after you have viewed and dismissed as unimportant any DebugView errors displayed when NoErr==false.
Not all errors are ignorable.

Nickname, String, default "" (not set) [Added v1.10].
Nicknames representing a clip index eg 'cp 37' instead of '5 37'.

Purge, bool, default True. (New v1.20)

False, do not Purge un-used clips.

True (Default), Purge unused clips. Set all un-used clips to NULL within ClipClop, so if they are not used
anywhere else, then clips can be released from memory. Purged clips shown when dv==3 or 4, ie INFO or DEBUG.


Clipclop is a simple plugin to replace ranges in a source clip with the same range,
from a selection of up to 255 replacement clips, unlimited range replacements.
The source clip must be supplied and at least one of the replacement clips must also to be
supplied or it will throw an error.
Also, the replacement clips must be in the same colorspace, same size as the source clip.
If the Rx clips are longer than the source clip, then the framecount will be truncated
to that of the source clip and will not produce an error (the clip itself will not be touched,
the plugin will consider it to have the same frame count as the source).

ClipClop will accept up to 255 replacment (Rx) clips, they are not named
and must follow the source clip. (Hopefully that is enough for those of you who are
very demanding [You know who you are]) ;)
Replacement clips start at R1 and go up to R255.

Either the command file (Cmd) or the Command string (SCmd) must also be supplied, if both
are supplied, the commands in the Command File are processed first followed by those in the
Command String. Where replacements are done more than once, the later one will take effect.


The Command file (Cmd) and the Command String (SCmd) will have a series of ranges to 'clop'
(ie replace) and will have the below format.

Rx(s,e)


Where the 'R' is optional and can be omitted.

where x is the replacement clip index number eg R7 is replacement clip 7, (the first one is R1).

Where the '(' and ')' are optional and if skipped then the opening '(' must be replaced by Comma ',' or ' ' (SPACE).

Where the ',' (COMMA) can be replaced with a ' ' (SPACE) [only needed if 'e' is specified].

Where the ')' is strictly speaking, unnecessary, whether the '(' is used or not.

s is the start frame and MUST be supplied.

e is optional and if missing, then the range will consist of only 1 frame.

If e=0, then the range will continue to the last frame of the REPLACEMENT CLIP (Rx) , it will not
produce an error if the replacement clip is shorter than the source clip. (would be limited to the
length of the shorter clip, either source or replacement).

If e is -ve (negative) then it will represent a -ve frame count eg -2 means 2 frames.

These are all valid:

R1 (35,42) # This is a comment
R1 65 374
2 1000
3 3700 5000
4 (36734,0) # My helicopter is full of penguins
5,23644,-3
R6,20,30)
R6(56,123

If the command file contained the above commands then clips R1 to R6 have all to be supplied to ClipClop.

The Cmd file commands MUST be line separated (ie one command per line).

The SCmd commands can be either Line Separated as the CMD commands or use a ';' SEMICOLON separator, as in

SCMD="R1(35,42) # My Zeppelin is full of lead ; R1 65 374
R2,1000,1200; R2(1400,1500)
R3(2000,-100) # My Spaceship is replete with aardvarks"


In SCmd, A SEMICOLON ';' would NOT be acceptable in a COMMENT, it would signify a new line and command pending
(ie PARSE error, it would look for a command following the ';').

R0 can be used in the commands to mean replace with the source clip, might be of use to reset
parts of a replaced range, back to how it originally was before previous clopping. Might be useful where
eg denoised clip used to replace a range, produced several unacceptable frames that need to be restored from
the original source.

-----------------------

v1.10, Nickname string is roughly the same format as SCMD, SEMICOLON (;) separated if on same line
or line separated, and can also contain comments. A Nickname, MUST start with either an underscore ('_'),
or an Alphabetic character ('A' -> 'Z' or 'a' -> 'z'). The remainder of the nickname can contain underscore,
alphabetic or numeric ('0' - '9') characters, as in "_Testing_123_Testing" or "AnyOldName_432" or "Fred".
The length limit on Nicknames is 31 characters.
There are a set of RESERVED names that CANNOT be redefined by Nickname, "Rnnn" or "rnnn" where 'nnn' represents
1 or more numeric digits. In a command file/string, you can use eg "R0" (or '0') to refer to the source clip and "R1"
to "R255" (or '1' to '255') to refer to the replacement clips whether or not they have nicknames applied.
As well as "(", "," and SPACE " " separators, a nickname allows "=". Below some valid examples:-

NickName = "
CopyFromPrevious=1 # Comment ; PredictFromNext,2 # another comment ; DN 3
CO=4
ZX(5)
QP (6)
XXX 7 # Patient: My hand hurts when I do this. ; ttt = 8 # Doctor: Then stop doing that!
ds123dgsdg__dld 9
ww(10
yy=11)
"

Nicknames do not have to be in ascending order, but might be best to keep them that way.

Using above Nickname example,

"dn 2000,3000" would replace source frames 2000 to 3000 with clip 3 frames 2000 to 3000, when used in a command
file or command string. Nicknames are case insignificant ('A' == 'a').

----------------------

If NoErr is true, then the plugin will try to avoid throwing an error for 'suspect' commands, not all
errors will be ignored.
Commands that do not fit in the valid formats described above will not be ignored (PARSE error).
-ve start frame will not be ignored (PARSE error, it could be clipped to 0, but I REFUSE to allow it).
If an Rx clip has been omitted (missed out) then all Rx commands can be ignored.
If a range fully or partially falls outside of either the source or Rx clips, then those can
be ignored (invalid part of the range).



It is recommended that you DO use the linked DebugView utility, to check out warnings,
ClipClop() will try to warn you if you need to re-evaluate your,,, evaluations.
It will warn of things like source and replacement clips being of different number of frames,
there is no need to be alarmed by the NoErr option, you do not have to use it.
Dont always use NoErr = true, unless you really really know what you
are doing [or your name is 'Cretindesalpes' :) ].

---------------------------------------------------------------------------------------------
Almost all of the hard work of ClipClop is done during setting up the filter. During the rendering
stage, ClipClop() does not do anything terribly clever, it just selects the frame to use from a
pre-calculated array or uses the source frame instead, but what it does do, it does fast as possible.
How can ClipClop be used, well if your source is mostly OK, but one range needs some sort of denoising,
and another range needs color correction and a third needs both, then you could eg create a denoised clip,
and create a color corrected clip, and a third with both denoising and color correction and
specify the ranges to 'clop' with the altered clips, Only the ranges that are actually
used with have the denoising/color correction done, and the source clip will be used most
of the time and those parts will be very fast.

Be warned, if you create a replacement clip using some ULTRA slow motion compensated function and eg
replace 1 in 10 frames then it will fly like the wind for 9 frames and jerk to an almost halt for 1, repeatedly,
this is not a problem in ClipClop(), it cannot make your ULTRA slow function go faster (It will be a little
disturbing if you do that but you could always use eg "AssumeFPS(0.001)" to smooth out the jerks it might however
take a little longer :)

---------------------------------------------------------------------------------------------

GetParity is implemented in the plugin as requested by Cretindesalpes (Thanks).

---------------------------------------------------------------------------------------------

Sister, Trim/splice plugin Prune() [v1.10 with Nicknames too].

http://forum.doom9.org/showthread.php?t=162446


---------------------------------------------------------------------------------------------

v1.20, NickName's are extended to allow MAGIC CLIPS.
Magic clips are handled more strictly and cannot be overwritten or redefined, and also cannot be used with a clip range,
the range (or more specifically the number of clips [or frames]) is fixed in the NickName definition of the Magic Clip.
Magic clips were added for a particular application and it is not expected that you will want to use them yourself,
the application is included in the AVS folder by name DoctorFrames.avs.
A Magic Clip is a series of associated clips which are treated as a special group, the number of clips in the group is
indicated by being preceded by a colon (':').
In NickName string,

NICKNAME="""
I3=6:3 # Interpolate 3 frames. Clips start at index 6, 3 clip group. Clip index's 6 to 6 + 3 - 1.
"""

In above case, the Magic group starts at clip 6 and consists of 3 clips (ie clip 6 to clip 8).
With a command of "I3 100" in either Cmd file or SCmd string,
Source_Frame Replaced_With
R0(100) R6(100)
R0(101) R7(100)
R0(102) R8(100)

You must use the NickName to do Magic Clip replacement, you cannot eg specify in SCMD "6 100", you must use eg "I3 100".
You cannot overwrite a Magic Clip replacement, it will produce an error.

---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------

Example usage script using NickNames:
###
Avisource("D:\avs\test.avi")
ORG=Last

V1 = FFT3DFilter(Plane=0,Sigma=1.6) # Light Luma
V2 = FFT3DFilter(Plane=0,Sigma=2.0) # Med Luma
V3 = FFT3DFilter(Plane=0,Sigma=4.0) # High Luma
V4 = FFT3DFilter(Plane=3,Sigma=1.6) # Light Chroma
V5 = FFT3DFilter(Plane=3,Sigma=2.0) # Med Chroma
V6 = FFT3DFilter(Plane=3,Sigma=4.0) # High Chroma
V7 = FFT3DFilter(Plane=4,Sigma=1.6) # Light Luma+Chroma
V8 = FFT3DFilter(Plane=4,Sigma=2.0) # Med Luma+Chroma
V9 = FFT3DFilter(Plane=4,Sigma=4.0) # High Luma+Chroma
V10= FlipHorizontal() # Flip-H
V11= FlipVertical() # Flip-V
V12= Invert() # Invert

NickNames =""" # Psuedonyms for clips (clip index number)
L0 = 1 # Light Luma
L1 = 2 # Med Luma
L2 = 3 # High Luma
C0 = 4 # Light Chroma
C1 = 5 # Med Chroma
C2 = 6 # High Chroma
LC0 = 7 # Light Luma + Chroma
LC1 = 8 # Med Luma + Chroma
LC2 = 9 # High Luma + Chroma
FH = 10 # Flip-H
FV = 11 # Flip-V
INV = 12 # Invert
"""

SCMD=""" # Clip editing commands in string, can also use commands in file
C0 0,99 # Light Chroma frames @ 0 -> 99
L0 100,-200 # Light Luma frames @ 100, 200 frames ie frames 100->299
INV 300,399 # Invert 300->399
L0 400,499 # Light Luma frames 400->499
FH 500,599 # Flip-H 500->599
LC2 600,699 # High Luma + Chroma
C1 800 # Med Chroma, Single frame
1 900,999 # Light Luma, We used the clip number instead of a NickName
FV 1000,1099 # Flip-V
LC1 2000,0 # Med Luma + Chroma, 2000 -> lastframe
"""

SHOW=True

ClipClop(ORG,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,scmd=SCMD,nickname=NickNames,show=SHOW)


EDIT: You might also find Prune() of interest, it is a Trim & Splice plugin.
http://forum.doom9.org/showthread.php?t=162446

Also Get this, DebugView
http://technet.microsoft.com/en-gb/sysinternals/bb545027

Available via Sig, mediafire.

cretindesalpes
17th August 2011, 22:15
Oh this is great, I used to stack a bunch of ReplaceFramesSimple() commands to select between multiple clips and it wasn't very convenient.

Suggestions: Make the possibility to enter the commands directly as a string (instead of a file)
Add a flag to truncate frame indexes in commands instead of emitting an error for frames out of range. This would avoid me to make a wrapper around ClipClop like I did with ReplaceFramesSimple to allow this.
Also allow Rx clips to have a number of frames different of the main clip.
You could also implement GetParity()

IanB
17th August 2011, 23:07
You could make the Replacement clip list an unlimited array instead of 10 fixed arguments, i.e. type string "cc+[cmd]s[show]b[ver]b".

Also you only test the width's are the same not the height's. ;)

StainlessS
18th August 2011, 02:45
Add a flag to truncate frame indexes

Not sure I get exactly what you mean there, could you spell out exactly how you envisage this please.
I will look into the other suggestions.

You could make the Replacement clip list an unlimited array instead of 10 fixed arguments, i.e. type string "cc+[cmd]s[show]b[ver]b".)

I did actually try to get that working (cc+), and even after reading a number of threads
on such (eg a thread by vcmohan, in which you took part), I
failed to get it working, and as I was in a hurry to get it
working, I reversed back to the way it had been working prior
to that. I actually like the ability to supply numbered clips and
was probably going to add a flag to ignore Rx commands where
Rx was not supplied. Also could easily increase command
indexes by using 0-9,A-Z, but might be a
bit tricky if only R were supplied instead of RR. I supplied the
AVSValue arg in question to the constructor, but It just kept
giving me zero number of elements in the array.
Would 36 replace clips be insufficient?, if adamant, then I guess
I could have another go at getting the cc+ thing working.


Also you only test the width's are the same not the height's.

Damn, could have sworn I've done that, only spent about a day,
maybe two on it. Will correct that and update, before going to
bed.

@all

Just for your info:-

Will also probably make a plugin that can take a list of trims and
output the result, probably with a number of source clips.
EDIT:- See Prune() in mentioned in 1st post.

Also, have currently got a plugin that uses comands for single
frame replacement using named commands for eg:

CP n, Copy frame n-1 into frame n from same source clip
CN n, Copy frame n+1 into frame n from same source clip
RF n, Copy frame n alternate clip into frame n of source clip.
PP n, Copy frame n from PredictFromPrev clip to n of source.
PN n, Copy frame n from PredictFromNext clip to n of source.

Where PredictFrom clips are created in a script using MVTools.
Also will add single frame bi-directional predicted clip and also
a pair of bi-directional replacement clips for a pair of damaged
frames.

Also, Got a plugin on the drawing board, (working but
incomplete) that selects single frames from a clip and could eg
be used to 'pull out' frames used in the eg CP plugin above.
This could be used instead of the CP plugin but using the same command
file to view the edited/un-edited frames without lots of scanning.
Also intend to give it the ability to pull out not just single frames but
also optionally to pull out a frame either side of the single
frames, and also the ability to put back a single frame in the
same place that it got them from, all using the same command
file. This would be potentially usefull for creating a RotoScoping
software tool, that could be given both frames either side of a
bad one to aid in hand repair of the frame in a RotorScoping
paint type program. Afterwards, a SelectEvery(3,1) would pick
out the edited frames and then put them back where they
belong. Of course the frames could be saved as Bitmaps for the
editing program if required and reloaded back into Avisynth
converted to the correct colorSpace before replacement.:rolleyes:

StainlessS
18th August 2011, 04:12
ClipClop v1.01 with height bug pointed out by IanB, fixed.
See attachment in first post (when cleared) or click on ExBlend in sig for MediaFire download.

cretindesalpes
18th August 2011, 08:24
Not sure I get exactly what you mean there, could you spell out exactly how you envisage this please.

Suppose we have this cmd.txt:

3 50 100
1 990 1100
7 2000 3000

and now we provide original and replacement clips with only 1000 frames. I would like the third command to be ignored and the second one truncated to range 990 999.

Gavino
18th August 2011, 12:11
Also could easily increase command indexes by using 0-9,A-Z, but might be a bit tricky if only R were supplied instead of RR.
Why restrict the clip indicator to be a single character?
Why not just allow any integer? (ie 10 and up as well)
I haven't looked at your source, but you obviously already have the ability to parse integers in order to recognise the frame numbers.

I prefer the "cc+" style interface. One of the advantages of a plugin over a script function is that you can have a variable number of arguments in this way. You must be doing something wrong in the code if you can't get this to work, as it is very simple to do.

StainlessS
18th August 2011, 12:47
@cretindesalpes,

Thankyou for your clarification, that is probably how I would have interpreted your request,
but was not 100% sure that was what you meant. It's coming.

@Gavino,

OK OK, enough already, I give up, shall have another go at the 'cc+' thing, but will I think keep the
original working style (perhaps renamed) for myself, will also give ability to use multicharacter
indexes.

EDIT: I guess I was fixated on the Rx commands using only two characters because that is how
they were originally implemented in another plugin with additional commands like CP and PN. The
Rx commands were seen (by me) as two character commands rather than a clip index, I guess
I left myself open to being forced to change, when I later made the 'R' optional, in ClipClop.

StainlessS
23rd August 2011, 04:54
Here, is a revised version of the ClipClop v1.02Beta, helpfile for your perusal.

EDIT: Link Removed.

StainlessS
27th August 2011, 00:49
New version, perhaps the last, ClipClop v1.03 for Avisynth 2.5+.

See First Post.

StainlessS
27th August 2011, 05:05
@cretindesalpes

v1.03, surpasses your requirements for ignoring out of range frames, it allows the Rx clips to be shorter
than the source clip (as well as longer) and will ignore ranges/partial ranges that are invalid for shorter
Rx clips. However, there is a tricky situation that I am unsure I have handled in the best manner.

Source clip 1000 frames, Rx clip 500 frames. How should I handle Rx(980,0),
The frame_end = 0 arg means frame 499 of the Rx clip and hence is below the
frame_start arg, and therefore a non ignorable ERROR. I could rearrange the logic
to check whether the start frame is higher than the end of Rx clip and ignore purely
on that, before the comparison end frame < start frame. Do you have any thoughts
in that area, perhaps you feel it would not be an issue, I would never use shorter
Rx clips with Clipclop.

EDIT: Anybody else feels like chiming in on the above question, please feel free.

cretindesalpes
28th August 2011, 10:33
I think it's good to ignore this error too. Let me explain my needs in detail. I have a framework for complex and resource-hungry avisynth processing. The whole processing is break up into multiple passes, and the clip is split into 1-minute segments, generating a lot of lossless intermediate files. A few .bat scripts run multiple avisynth instances simultaneously to process the segments and synchronize after each pass until all passes are done.

When I'm processing segment S from pass P, the avs script loads and concatenates segments S-1, S and S+1 from pass P-1 (or any other previous pass), inserts blank frames at the beginning to shift the loaded content at its original position but does nothing at the end. The result is trimmed to segment S. I use a single script per pass and all mentioned frames numbers are relative to the clip beginning, as if it was all in one piece. And this is where I need the plugin to ignore out-of-range frames when they are not requested, because when processing a segment, the script doesn't know the real length of the full clip. A plugin like TFM has this very issue with its override file, but as a workaround, it gracefully handles a Loop(-1) on its input and a subsequent Trim(), so it's easy to write a wrapper around it. ReplaceFrameSimple isn't fixed as easily, that's why I greatly appreciate this working alternative.

StainlessS
29th August 2011, 02:53
@cretindesalpes

I am sorry, it seems my answer to you got a bit lost
I did do a significant post, but it aint here now.

(EDIT: my Mobile Broadband keeps disconnecting me lately.)

Here, is a revised version of the ClipClop v1.04,
See 1st post.

StainlessS
5th November 2011, 07:42
Clipclop() v1.05 update see first post, available via sig until attachement cleared.

StainlessS
25th March 2012, 03:35
New Version v1.10, Major improvement, see 1st post.

ClipClop() v1.10, Range/Frame Replacement Plugin for Avisynth v2.5+ by StainlessS.

Planar, YUY2, RGB32, RGB24.

Does NOT affect Audio (as source clip).

Clipclop is a simple plugin to replace ranges in a source clip with the same range, from a replacement clip.
Supports up to 255 replacement clips, with unlimited number of replacements into output clip.


If you wanted to do 1000 single frame replacements in script, that would require 3 trims and 2 splices for each
replaced frame, ie 3000 trims and 2000 splices. This would involve 5000 'zero cost' filters which together will
cost a little more than zero. With ClipClop(), this is reduced to 1 single filter with an overhead of approx
1 trim or splice filter. There is a small overhead setting up the filter (before the very 1st frame is fetched)
while parsing the file/string commands, but then parsing and setting up 5000 trim/splice filters in a script
would not be without cost either. Clipclop can parse in the region of 40000 commands (from file) in about 1 second
[guessed, based on timing the sister plugin Prune(), a trim/splice plugin].

v1.10, Implements 'Nickname's, Pseudonyms for the replacement clips, ie instead of '17 100,200' you could use eg 'dn 100,200',
in this case it might be to replace frames 100 to 200 of the source clip with the same frames of a denoised clip (clip 17).
OR, 'cp 345' to replace frame 345 with a clip where frame n was copied from frame n-1 of the source clip, ie CopyFromPrevious
[this could be generated via 'SelectEvery(1,-1)', or 'CopyFromNext' clip by 'SelectEvery(1,1)].
Supports Nicknames of up to 31 characters in length so you could use eg 'PredictFromPrevious 1234', or 'FlippedVertical 666,999'.
Nicknames allow you to think in terms of functionality rather than to keep looking up which clip index holds a modified clip
and you could actually write your command file/string before you even know how many clips you need, what clip index they will be,
or even how you will actually create/process the clip.

Once you've tried ClipClop(), you will wonder why you spent all those years doing it the hard way.
(Repeat after me, "I dooo believe in Fairies!".)


You can call me Tinkerbell if you like.

StainlessS
27th March 2012, 05:34
Here a modification of a script function posted by Gavino (Thankyou Maestro)
http://forum.videohelp.com/threads/322848-Scripts-and-filters-for-an-Opera-%28sample-videos-included%29?p=2089696&viewfull=1#post2089696
EDIT: Update version of below DoctorFrames included in zip, with frame interpolations up to 22 frames.
Function DoctorFrames(clip c, String "Scmd",String "Cmd",bool "Show",int "dv") {
# Replace damaged single frames using commands in a either command string or file.

Scmd = Default(Scmd,"") # User supplied list of newline or semicolon separated commands.
Cmd = Default(Cmd,"") # User supplied Filename containing newline separated commands.
Show = Default(Show,false) # Show Info on frame
dv = Default(dv,0) # ClipClop DebugView level (Need DebugView utility)

sup = c.MSuper()
PreFilt = c.DeGrainMedian() # prefiltered for better motion analysis
supPreFilt = PreFilt.MSuper()

ci_bv = sup.MAnalyse(isb=true, delta=2)
ci_fv = sup.MAnalyse(isb=false, delta=2)
ci = c.MFlowInter(sup,ci_bv, ci_fv, time=50.0, ml=100).DuplicateFrame(0).Trim(0,c.Framecount()-1)

cp = c.SelectEvery(1,-1).Trim(0,c.Framecount()-1) # chop off extra frame
cn = c.SelectEvery(1,1).DuplicateFrame(c.Framecount()-1) # Make same length as source

pp_fv = supPreFilt.MAnalyse(isb = false, truemotion=true,delta = 1)
pp=c.MFlow(sup,pp_fv)

pn_bv = supPreFilt.MAnalyse(isb = true, truemotion=true,delta = 1)
pn=c.MFlow(sup,pn_bv)

NickName=" # Define Command mnemonics allowed in command string and file.
CI=1 # CopyFromInterpolated
CP=2 # CopyFromPrevious (frame n replaced with frame n-1)
CN=3 # CopyFromNext (frame n replaced with frame n+1)
PP=4 # PredictFromPrevious (frame n replaced with frame predicted from frame n-1)
PN=5 # PredictFromNext (frame n replaced with frame predicted from frame n+1)
"
Return c.ClipClop(ci,cp,cn,pp,pn,scmd=Scmd,cmd=Cmd,nickname=Nickname,show=show,dv=dv)
}

Avisource("D:\avs\avi\TEST.AVI")
Trim(1000,-10) ++ trim(2000,-10) ++ trim(3000,-10) # Make two scene changes

SCMD="
CI 5 # CopyFromInterpolated clip frame 5
CP 9 # CopyFromPrevious at last frame before scene change
CN 10 # CopyFromNext at first frame of scene change
CI 15 # CopyFromInterpolated clip frame 15
PP 19 # PredictFromPrevious at last frame before scene change
PN 20 # PredictFromNext at first frame of scene change
CI 25 # CopyFromInterpolated clip frame 25
"

DoctorFrames(Scmd,show=true)

Function Could easily be extended.

Thread on fixing broken frames here:-
http://forum.doom9.org/showthread.php?t=152758

EDIT:- For single frame repair only.
EDIT:- Easy to mod for eg frame range denoising.
EDIT:- @IanB & Gavino, Thanx for impelling the array of clips, would never have gotten here otherwise.

EDIT: SCMD using mnemonics is equivalent to this (the mnemonic just an alternative means of giving clip index number)

SCMD="
1 5 # CopyFromInterpolated clip frame 5
2 9 # CopyFromPrevious at last frame before scene change
3 10 # CopyFromNext at first frame of scene change
1 15 # CopyFromInterpolated clip frame 15
4 19 # PredictFromPrevious at last frame before scene change
5 20 # PredictFromNext at first frame of scene change
1 25 # CopyFromInterpolated clip frame 25
"

StainlessS
27th March 2012, 08:21
See Also previous post

Would anyone be interested in my extending the ClipClop Nickname's to include multiple single frame replacements
from multiple consecutive clips, explaination:

A Nickname including eg "CI_PAIR=22,2" and a command supplied as "CI_PAIR 100" might be used to replace frame
100 with frame 100 of clip 22 and frame 101 with frame 100 of clip 23.
Likewise, Nickname of "CI5=66,5" could eg allow you to use commands like "CI5 1000" to repair 5 frames
from frame 1000 but only requiring the frame number of the first frame (would require 5 replacement clips [66 - 70] for the operation).

Any thoughts ? :thanks:

EDIT: could also be used to eg replace a pair of frames at scene change, if frame n is frame before
scene change then replace n with n-1 and n+1 with n+2 (either copied or predicted).

EDIT: Above suggestion implemented in v1.2 as MAGIC CLIPS.

lintran
25th May 2013, 06:21
Dear!
I love your plug-in ClipClop (http://forum.doom9.org/showthread.php?t=162266). But difficult to figure it out. So if i have an avs script like that

LoadPlugin("VSFilterMod.dll")
LoadPlugin("ffms2.dll")
v001=FFVideoSource("VIDEO.mkv", threads=1).TextSubMod("A.ass").Trim(0,970).Logo("B.png",Start=50,End=920,I=12,O=12).FadeIn0(3).FadeOut0(3)
v002=FFVideoSource("VIDEO.mkv", threads=1).Trim(971,1118).Logo("B.png",Start=50,End=97,I=12,O=12).FlipHorizontal().FadeIn0(3).FadeOut0(3)
v003=FFVideoSource("VIDEO.mkv", threads=1).Trim(1119,1266).Logo("B.png",Start=50,End=97,I=12,O=12).FlipVertical().FadeIn0(3).FadeOut0(3)
v004=FFVideoSource("VIDEO.mkv", threads=1).Trim(1267,1548).Logo("B.png",Start=50,End=231,I=12,O=12).FlipHorizontal().FlipVertical().FadeIn0(3).FadeOut0(3)
v005=FFVideoSource("VIDEO.mkv", threads=1).Trim(1549,28169).Logo("B.png",Start=50,End=26570,I=12,O=12).FlipVertical().FadeIn0(3).FadeOut0(3)
v006=FFVideoSource("VIDEO.mkv", threads=1).Trim(28170,39426).Logo("B",Start=50,End=11206,I=12,O=12).FlipHorizontal().FlipVertical().FadeIn0(3).FadeOut0(3)
v007=FFVideoSource("VIDEO.mkv", threads=1).Trim(39427,120881).Logo("B",Start=50,End=81404,I=12,O=12).FlipVertical().FadeIn0(3).FadeOut0(3)
v008=FFVideoSource("VIDEO.mkv", threads=1).Trim(120882,128426).Logo("B.png",Start=50,End=7494,I=12,O=12).FlipHorizontal().FlipVertical().FadeIn0(3).FadeOut0(3)
v009=FFVideoSource("VIDEO.mkv", threads=1).Trim(128427,128617).Logo("B.png",Start=50,End=140,I=12,O=12).FadeIn0(3).FadeOut0(3)
v010=FFVideoSource("VIDEO.mkv", threads=1).Trim(128618,128768).Logo("B.png",Start=50,End=100,I=12,O=12).FlipHorizontal().FlipVertical().FadeIn0(3).FadeOut0(3)
v001+v002+v003+v004+v005+v006+v007+v008+v009+v010
LanczosResize(852,480)

could you write an avs script for my avs using ClipClop?
I need an example to understand. Thank you so much.

StainlessS
25th May 2013, 15:20
Sorry, but best I can suggest is


LoadPlugin("VSFilterMod.dll")
LoadPlugin("ffms2.dll")

FFVideoSource("VIDEO.mkv", threads=1)

v001= TextSubMod("A.ass").Trim(0,970).Logo("B.png",Start=50,End=920,I=12,O=12).FadeIn0(3).FadeOut0(3)
v002= Trim(971,1118).Logo("B.png",Start=50,End=97,I=12,O=12).FlipHorizontal().FadeIn0(3).FadeOut0(3)
v003= Trim(1119,1266).Logo("B.png",Start=50,End=97,I=12,O=12).FlipVertical().FadeIn0(3).FadeOut0(3)
v004= Trim(1267,1548).Logo("B.png",Start=50,End=231,I=12,O=12).FlipHorizontal().FlipVertical().FadeIn0(3).FadeOut0(3)
v005= Trim(1549,28169).Logo("B.png",Start=50,End=26570,I=12,O=12).FlipVertical().FadeIn0(3).FadeOut0(3)
v006= Trim(28170,39426).Logo("B",Start=50,End=11206,I=12,O=12).FlipHorizontal().FlipVertical().FadeIn0(3).FadeOut0(3)
v007= Trim(39427,120881).Logo("B",Start=50,End=81404,I=12,O=12).FlipVertical().FadeIn0(3).FadeOut0(3)
v008= Trim(120882,128426).Logo("B.png",Start=50,End=7494,I=12,O=12).FlipHorizontal().FlipVertical().FadeIn0(3).FadeOut0(3)
v009= Trim(128427,128617).Logo("B.png",Start=50,End=140,I=12,O=12).FadeIn0(3).FadeOut0(3)
v010= Trim(128618,128768).Logo("B.png",Start=50,End=100,I=12,O=12).FlipHorizontal().FlipVertical().FadeIn0(3).FadeOut0(3)

v001+v002+v003+v004+v005+v006+v007+v008+v009+v010
LanczosResize(852,480)


ClipClop would be wrong plug anyway, it replaces ranges/frames in already existing clip, with same ranges/frames from up to 255
alternate clips.

Prune, might be more appropriate but each and every trim needs different manipulation and so there would be no advantage over using
plain trims.

Prune would be better if you had maybe 4 or 5 (or more) clips and wanted select multiple ranges from each of them and splice them together.

StainlessS
17th August 2014, 21:45
ClipClop() v1.20, see 1st post.


17/Aug/2014 - ver 1.20 - Versions 2.5 and 2.6. Added Magic.


Doc mods.

ClipClop(clip source, clip R1, ... , clip R255, string 'Cmd',string 'SCmd', bool 'Show', bool 'Ver',int 'dv', bool 'NoErr',string "Nickname",bool "Purge")

...

Purge, bool, default True. (New v1.20)

False, do not Purge un-used clips.

True (Default), Purge unused clips. Set all un-used clips to NULL within ClipClop, so if they are not used
anywhere else, then clips can be released from memory. Purged clips shown when dv==3 or 4, ie INFO or DEBUG.

...


v1.20, NickName's are extended to allow MAGIC CLIPS.
Magic clips are handled more strictly and cannot be overwritten or redefined, and also cannot be used with a clip range,
the range (or more specifically the number of clips [or frames]) is fixed in the NickName definition of the Magic Clip.
Magic clips were added for a particular application and it is not expected that you will want to use them yourself,
the application is included in the AVS folder by name DoctorFrames.avs.
A Magic Clip is a series of associated clips which are treated as a special group, the number of clips in the group is
indicated by being preceded by a colon (':').
In NickName string,

NICKNAME="""
I3=6:3 # Interpolate 3 frames. Clips start at index 6, 3 clip group. Clip index's 6 to 6 + 3 - 1.
"""

In above case, the Magic group starts at clip 6 and consists of 3 clips (ie clip 6 to clip 8).
With a command of "I3 100" in either Cmd file or SCmd string,
Source_Frame Replaced_With
R0(100) R6(100)
R0(101) R7(100)
R0(102) R8(100)

You must use the NickName to do Magic Clip replacement, you cannot eg specify in SCMD "6 100", you must use eg "I3 100".
You cannot overwrite a Magic Clip replacement, it will produce an error.



EDIT: Thread that eventually prompted Magic Clip implementation:- http://forum.doom9.org/showthread.php?p=1690262#post1690262

Jenyok
26th August 2014, 17:14
StainlessS
.
Where could I download ClipClop v1.20 ?
No http link to download found.
.

StainlessS
26th August 2014, 19:55
As it says at bottom of 1st post in ClipClop thread, "Available via Sig, mediafire.", also available via SendSpace.

See sig below this post (or any other of my posts) .

StainlessS
5th October 2014, 14:52
@Jenyok, Did you get it working OK ?

@gnol009 (replying to your PM)

You could have posted that spreadsheet thing in thread, no need for PM.
ClipClop(), is intended to replace ranges in one clip with the same range from another, just like ReplaceFramesSimple but with up to 255 replacement clips.

For your purpose where you are wanting to trim and splice ranges from two or more non frame synced clips, you would need to use Prune which does just that.
Prune: http://forum.doom9.org/showthread.php?t=162446&highlight=Prune

Good Luck.

Jenyok
9th October 2014, 10:03
I tried to use ClipClop new version, but it doesn't works.
.

StainlessS
9th October 2014, 12:17
Any clue as to what doesn't works ?

You just talking about the DoctorFrames.avs ?
Did you try with SetMemoryMax(256) ?

StainlessS
18th November 2014, 05:20
ClipClop() v1.21 new version see 1st post.


18/Nov/2014 - ver 1.21 - Fixed, was showing R%x hex Rx Clip instead of R%d decimal.


Bug Fix, In metrics was showing hexadecimal number when Rx clip was 10 or more (Ra instead of R10),
I guess thats what comes about with continually referring to the replacement clips as Rx clips.


Here Example script added to doc, too big for 1st post text.



Example usage script using NickNames:
###
Avisource("D:\avs\test.avi")
ORG=Last

V1 = FFT3DFilter(Plane=0,Sigma=1.6) # Light Luma
V2 = FFT3DFilter(Plane=0,Sigma=2.0) # Med Luma
V3 = FFT3DFilter(Plane=0,Sigma=4.0) # High Luma
V4 = FFT3DFilter(Plane=3,Sigma=1.6) # Light Chroma
V5 = FFT3DFilter(Plane=3,Sigma=2.0) # Med Chroma
V6 = FFT3DFilter(Plane=3,Sigma=4.0) # High Chroma
V7 = FFT3DFilter(Plane=4,Sigma=1.6) # Light Luma+Chroma
V8 = FFT3DFilter(Plane=4,Sigma=2.0) # Med Luma+Chroma
V9 = FFT3DFilter(Plane=4,Sigma=4.0) # High Luma+Chroma
V10= FlipHorizontal() # Flip-H
V11= FlipVertical() # Flip-V
V12= Invert() # Invert

NickNames =""" # Psuedonyms for clips
L0 = 1 # Light Luma
L1 = 2 # Med Luma
L2 = 3 # High Luma
C0 = 4 # Light Chroma
C1 = 5 # Med Chroma
C2 = 6 # High Chroma
LC0 = 7 # Light Luma + Chroma
LC1 = 8 # Med Luma + Chroma
LC2 = 9 # High Luma + Chroma
FH = 10 # Flip-H
FV = 11 # Flip-V
INV = 12 # Invert
"""

SCMD=""" # Clip editing commands in string, can also use commands in file
C0 0,99 # Light Chroma frames @ 0 -> 99
L0 100,-200 # Light Luma frames @ 100, 200 frames ie frames 100->299
INV 300,399 # Invert 300->399
L0 400,499 # Light Luma frames 400->499
FH 500,599 # Flip-H 500->599
LC2 600,699 # High Luma + Chroma
C1 800 # Med Chroma, Single frame
1 900,999 # Light Luma, We used the clip number instead of a NickName
FV 1000,1099 # Flip-V
LC1 2000,0 # Med Luma + Chroma, 2000 -> lastframe
"""

SHOW=True

ClipClop(ORG,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,scmd=SCMD,nickname=NickNames,show=SHOW)

Above example first posted here: http://forum.doom9.org/showthread.php?p=1699870#post1699870

EDIT: Displays metrics for frame 300 in above example script, R12 is the generic name for (replacement) clip 12.

300 ] ClipClop:
Using Clip INV{R12}[300]

videoFred
27th November 2014, 20:02
I'm using ClipClop to apply interpolation only on certain scenes and apply convertFPS() on the other scenes. My source files are transfered 8mm films, 18fps progressive.

This simple script works like a charm:
source=Avisource("L:\CanocapsVDPspoel_#4.0_gekuist.avi").converttoYV12()
converted = source.ConvertFPS(25)


V0 = converted
V1 = InterFrame(source,Newnum=25,Newden=1,Cores=8,GPU=true)


NickNames =""" # Psuedonyms for clips

I = 1
"""


SCMD="""

I 1723,2312
I 3032,3202
I 3915,4456

"""

SHOW=True

ClipClop(V0,V1,scmd=SCMD,nickname=NickNames,show=SHOW)

But now I would like to run the interpolated scenes a bit slower. This can be done with assumeFPS() before the interpolation of cource but then the frame numbers for the replacements are not matching any more of cource.

Does anyone has an idea how to solve this?

Thank you in advance,
Fred.

StainlessS
27th November 2014, 21:10
Fred, I think maybe try Prune instead for your purpose as they will really be two different clips.
http://forum.doom9.org/showthread.php?t=162446&highlight=prune


Prune() v1.10, Trim/Splice Plugin for Avisynth v2.5+ by StainlessS.

http://forum.doom9.org/showthread.php?t=162446

Video:- Planar, YUY2, RGB32, RGB24.

Audio:- FLOAT, INT16, INT32, for Audio Fade, ALL types supported if NOT fading (Pass through untouched).

Prune is a simple plugin to trim() multiple source clips and splice the results into a new clip.
Supports up to 256 source clips, with unlimited number of trims/splices into output clip.
Prune can fade Audio (to reduce clicks between splices) for supported audio formats.
The plugin will do AlignedSplice only.

v1.10, Implements 'Nickname's, Pseudonyms for the source clips, ie instead of '17 1000,2000' you could use
eg 'Holidays_Aug_2011 1000,2000', to splice frames 1000 to 2000 of the clip 17 into the output clip.
Supports Nicknames of up to 31 characters in length so you could use eg 'UncleBobsBirthdayBash 10000,14560', or
'Fred_And_Bobs_Wedding_Part_1 3485,6023'.


Prune(Clip R0, clip R1, ... , clip R255, string 'Cmd',string 'SCmd', bool 'Show', bool 'Ver',int 'dv', bool 'NoErr',
float 'Fade', bool 'FadeIn', bool 'FadeSplice', bool 'FadeOut', String 'Nickname')


You might also be interested in FrameSel, it has some neat (cant believe I used that word) little tricks that it can perform.
http://forum.doom9.org/showthread.php?t=167971&highlight=framesel


FrameSel/Rep() Plugins for Avisynth v2.58/v2.6 by StainlessS.

FrameSel() is a simple plugin to select individual frames from a clip.

Can select frames numbers by direct arguments to filter, or in a string, or in a command file.


Video:- Planar, YUY2, RGB32, RGB24.

Audio:- Returns NO AUDIO (Does not really make sense for individual frames, although now supports ranges).


FrameSel(Clip, int F1, ... , int Fn, string 'scmd',string 'cmd', bool 'show', bool 'ver',bool "reject",bool "ordered",
\ bool "debug", int "Extract"=1)

...

Reject bool, Default False. If true then selects frames NOT specified rather than specified frames.
eg if you have a 5 frame clip (0->4) and have commands to select 4,2 and 0, then reject=true would actually
select frames 1 and 3 instead.
If reject=true, then orderering occurs no matter whether Ordered is set true or false and the frames are returned
in sequential order.
Reject might be of use to view all frames NOT in a frames command set.

Ordered bool, Default true. No effect if reject is true, where Ordered will ALWAYS be as if set true.
If true then all selected frames are sequentially ordered and only unique frames are selected
and returned in sequential order. If Ordered is set false, no frame number ordering is done and eg if
frames 10,20,30,20,10 were selected in commands, then it would select 5 frames; 10 and 20 and 30 and 20 and 10,
are returned and in that order. If Ordered is set default true, then for same example it would return 10 and 20
and 30, in that sequential order.
So, the purpose of Ordered=true (default), is to remove duplicates and return sequential frames.
Only change Ordered to false if you are convinced you know what you are doing.

Debug bool, Default false. If true sends a little debug info to debugview window during Plugin initialization. (Google DebugView).

Extract Int, Default 1, MUST be ODD, 1 to 11. Error if not default 1 AND neither Ordered nor Reject == True.
Let us call the UNIQUE resultant frames after Ordered and/or Reject Processing 'Target' frames.
The number of frames pulled out on either side of Target frame is Extract / 2 (integer divide), so when Extract=3, it will
extract 1 frame before target, the Target frame, and 1 frame after target, for each and every Target frame.
This arg allows you to select eg 3 frames for each Target frame, the previous frame, Target frame and next frame.
May be of use to extract bad frames together with eg 1 frame either side for saving as bitmaps and editing
in some kind of RotoScope editor to repair bad frames using image from adjacent frames. The edited frames could
then be re-loaded, middle one selected via SelectEvery(3,1), and then put back into original source clip via FrameRep().
Another simple use could be when you have a clip where each frame before a scene change is bad, with Ordered=True
and Extract=3, you pull out 3 frames, a SelectEvery(3,0) would select the frames previous to the bad frames and
then use Framerep() to replace the bad frames with those previous to them. A SelectEvery(3,2) would select the frames
after Target frames.
The total number of frames pulled out of the source clip will be (Extract * number of Target frames).
Reject is less likely to be of use with Extract, unless frame select commands specify good frames rather than bad,
where Reject in FrameRep should also be true (same as in FrameSel, as always).
See FrameRep() for example uses of Extract.





FrameRep(Clip c,Clip c2 int F1, ... , int Fn, string 'scmd',string 'cmd', bool 'show', bool 'ver',bool "reject",bool "debug")

Video:- Planar, YUY2, RGB32, RGB24.

Audio:- Returns source clip c audio.

Args identical to FrameSel, with exception of the compulsory 2nd clip arg which is a clip of frames to replace into the 1st source clip,
and also does not have an Ordered argument, as it is ALWAYS Ordered, and FrameRep, does not have the Extract arg.

See FrameSel() description for other arguments.

FrameRep() is complimentary to FrameSel, whereas FrameSel extracts frames, FrameRep replaces or reseats them (from the c2 clip) back from
whence they came (into the c clip) and using the EXACT same arguments and commands (whether directly supplied or in string command or
file command). If you wish to extract some frames and later replace back into the source clip, you MUST use the default Ordered=True in
FrameSel or the frames may not be replaced back into the positions they originally came from.

The number of Unique Selected frames in the combined frames commands MUST EQUAL the number of frames in the c2 clip (after taking Reject
into account), or it WILL throw an error, (will not know where to put the remainder or frame shortage). This is the reason you should
use the same frame commands in both FrameSel and FrameRep so that there will be an identical number of unique frames and Ordered
sequential. If Debug is set true, it will show a little info in DebugView (Google), eg number of unique frames in a command set.



FrameSel_CmdReWrite(Clip c,String ofn, int F1, ... , int FN, String "SCmd"="", String "Cmd"="", \
Bool "Reject"=False, Bool "Ordered"=True, Bool "Debug"=False, Bool "Range"=True, Bool "Space"=False, Bool "Prune"=False)

FrameSel_CmdReWrite, takes either Frame numbers as direct arguments, or in the SCmd string, or in the Cmd file (at least one must
be specified). If more than one command method is used, will process Cmd file first, then SCmd string second and lastly
directly supplied frame numbers. The command frames will be acted upon via the Reject, and Ordered, args (as in FrameSel)
and then re-written to the output command file. Any comments in SCmd string or Cmd file will not be written to the output
command file.

The FrameSel_CmdReWrite() function returns the total number of frames written to the output file (including ranges).

This function could have several uses:-
To combine multiple frame specifying command methods into a single command file, and if Ordered, then remove duplicates.
Convert single frame command files to frame range command files, (smaller and perhaps easier to peruse).
Convert frame range command files to single frame command files, for use in another plugin that expects only frame numbers.
Convert a Reject=True command set to Reject=False command file, and vice versa.
Convert a command file of single frames/ranges to reject from a clip, into a Prune command file (Prune does not itself have a
Reject arg but it does fadein/out audio at splices and can also coalesce single frames into ranges before splicing so that
it does not fadein/out at every single individually specified frame).
Perhaps more uses.


Could you say what your running, OS, 32/64 and memory size please, I seem to have a problem on 64Bit mem > 4GB, thanx
(ClipClop crash, I am on 32bit 4GB).

EDIT: You would need to use the output frame numbers of the speed altered clips.
EDIT:
Perhaps you could send highest framerate clip through Scriptclip, where you could calc and Subtitle output and orig frame numbers,
eg Source TLHS, ConvertFPS MidLHS and Interpolated BLHS. (or maybe better to use source clip rather than hi framerate clip)

videoFred
27th November 2014, 22:56
EDIT: You would need to use the output frame numbers of the speed altered clips.

Thank you for the fast answer StainlessS! Yes, I already do this, that's why I use the 'converted' clip to get the correct frame numbers. This already works perfect for now: I can mix ConvertFPS() and Interframe() interpolation with a simple frame numbers list. But I want more of cource :p


EDIT:
Perhaps you could send highest framerate clip through Scriptclip, where you could calc and Subtitle output and orig frame numbers,
eg Source TLHS, ConvertFPS MidLHS and Interpolated BLHS. (or maybe better to use source clip rather than hi framerate clip)

Yes, the ideal situation would be to make a list from the original 18fps source clip where to apply interpolation and then recalculate this to the hi framerate clip and then replace those frames with the interpolated ones.

Anyhow, I will have a look at your suggestions and it seems I will have a lot to learn :)

PS: I'm on Win7 64bits and everything runs fine but my clips are always below 30.000 frames.

Fred.

StainlessS
27th November 2014, 23:34
Thank you Fred, I'm guessin that you also have more than 4GB of RAM and so am at a loss as to what the problem is that is affecting Jenyok and Hotte.
Midway re-installing 6 systems together with all tweaks and such, then gotta install VS Express 2008 and try that out before I can try to figure out where my problem lies.

EDIT: No, I mean 8 systems, I forgot a couple :eek:

StainlessS
21st December 2014, 23:00
@Jenyok,
Are you using an old version of Avisynth v2.6, If so, you need to update as ClipClop uses new AvisynthPluginInit3() only available in Alpha 4+ ?
(Or alternatively use the v2.58 dll).

StainlessS
29th March 2015, 19:50
ClipClop v1.22, new version see 1st post.


17/Aug/2014 - ver 1.20 - Versions 2.5 and 2.6. Added Magic.
18/Nov/2014 - ver 1.21 - Fixed, was showing R%x hex Rx Clip instead of R%d decimal.
29/Mar/2015 - ver 1.22 - Recompile with VS 2008 and v2.6 dll with Avisynth 6 Header(EDIT: from RC1).

StainlessS
1st April 2015, 19:14
ClipClop v1.23, see 1st post.
Minor mod, Display NickNames in original casing when Show=true (was all uppercased).

StainlessS
16th April 2016, 18:59
Here much reduced size DoctorFrames script, with bug fix.

First the bug fix

Return c.ClipClop(
\ CP,
\ CN,
\ I01_01,
\ I02_01,I02_02,
\ I03_01,I03_02,I03_03,
\ I04_01,I04_02,I04_03,I04_04,
\ I05_01,I05_02,I05_03,I05_04,I05_05,
\ I06_01,I06_02,I06_03,I06_04,I06_05,I06_06,
\ I07_01,I07_02,I07_03,I07_04,I07_05,I07_06,I07_07,
\ I08_01,I08_02,I08_03,I08_04,I08_05,I08_06,I08_07,I08_08,
\ I09_01,I09_02,I09_03,I09_04,I09_05,I09_06,I09_07,I09_08,I09_09,
\ I10_01,I10_02,I10_03,I10_04,I10_05,I10_06,I10_07,I10_08,I10_09,I10_10,
\ I11_01,I11_02,I11_03,I11_04,I11_05,I11_06,I11_07,I11_08,I11_09,I11_10,I11_11,
\ I12_01,I12_02,I12_03,I12_04,I12_05,I12_06,I12_07,I12_08,I12_09,I12_10,I12_11,I12_12,
\ I13_01,I13_02,I13_03,I13_04,I13_05,I13_06,I13_07,I13_08,I13_09,I13_10,I13_11,I13_12,I13_13,
\ I14_01,I14_02,I14_03,I14_04,I14_05,I14_06,I14_07,I14_08,I14_09,I14_10,I14_11,I14_12,I14_13,I14_14,
\ I15_01,I15_02,I15_03,I15_04,I15_05,I15_06,I15_07,I15_08,I15_09,I15_10,I15_11,I15_12,I15_13,I15_14,I15_15,
\ I16_01,I16_02,I16_03,I16_04,I16_05,I16_06,I16_07,I16_08,I16_09,I16_10,I16_11,I16_12,I16_13,I16_14,I16_15,I16_16,
\ I17_01,I17_02,I17_03,I17_04,I17_05,I17_06,I17_07,I17_08,I17_09,I17_10,I17_11,I17_12,I17_13,I17_14,I17_15,I17_16,I17_17,
\ I18_01,I18_02,I18_03,I18_04,I18_05,I18_06,I18_07,I18_08,I18_09,I18_10,I18_11,I18_12,I18_13,I18_14,I18_15,I18_16,I18_17,I18_18,
\ I19_01,I19_02,I19_03,I19_04,I19_05,I19_06,I19_07,I19_08,I19_09,I19_10,I19_11,I19_12,I19_13,I19_14,I19_15,I19_16,I19_17,I19_18,I19_19,
\ I20_01,I20_02,I20_03,I20_04,I20_05,I20_06,I20_07,I20_08,I20_09,I20_10,I20_11,I20_12,I20_13,I20_14,I20_15,I20_16,I20_17,I20_18,I20_19,I20_20,
\ I21_01,I21_02,I21_03,I21_04,I21_05,I21_06,I21_07,I21_08,I21_09,I21_10,I21_11,I21_12,I21_13,I21_14,I21_15,I21_16,I21_17,I21_18,I21_19,I21_20,I21_21,
\ I22_01,I22_02,I22_03,I22_04,I22_05,I22_06,I22_07,I22_08,I22_09,I22_10,I22_11,I22_12,I22_13,I22_14,I22_15,I22_16,I22_17,I22_18,I22_19,I22_20,I22_21,I22_22,
\ scmd=SCMD,cmd=CMD,nickname=NICKNAME,show=SHOW,dv=DV)
""")
}

The bit hi-lited in red did read I03_02 instead of I03_03.

Here update, Reduced maximum possible number of frames interpolated to 20 (from 22, about 43 fewer clips generated and more stable).
Still best to use SetMemoryMax(256) if using max 20.
Here update,


Function DoctorFrames(clip c, String "Scmd",String "Cmd",bool "Show",int "dv",Int "MaxInterp",
\ int "pel",int "sharp",int "rfilter",Float "ml") {
/*
# DoctorFrames() by StainlessS. Req ClipClop, RT_Stats, GSCript, MvTools.
# Replace damaged frames using commands in a either command string or file.
Commands:- Eg, "CP 100" CopyFromPrevious ie replace frame 100 with frame 100 - 1.
Eg, "CN 200" CopyFromNext ie replace frame 200 with frame 200 + 1.
Eg, "I2 300" Interpolate 2 frames at frames 300 and 301 (using 299 and 302 as source frames).
Eg, "I20 400" Interpolate 20 frames at frames 400 to 419 (using 399 and 420 as source frames).
NOTE, You specify the first frame number that is to be interpolated eg "I3 45" specifies 3 frames
interpolated starting at frame 45.
*/
Scmd = Default(Scmd,"") # User supplied list of newline or semicolon separated commands.
Cmd = Default(Cmd,"") # User supplied Filename containing newline separated commands.
Show = Default(Show,false) # Show Info on frame
dv = Default(dv,0) # ClipClop DebugView level (0 - 4, Need DebugView utility)
MaxInterp= Default(MaxInterp,9) # Default 9. Maximum number of Interpolation frames replaced. Max possible 20.
# When 20 (or close), will likely need eg SetMemoryMax(256) to avoid 'Out of Memory' Errors.
# A MaxInterp of 20, requires in excess of 200 clips, and hits system resources heavily.
pel = Default(pel,2) # Default as for MSuper(), ie 2, range=1 or 2 or 4
sharp = Default(sharp,2) # Default as for MSuper(), ie 2, range=0 -> 2
rfilter= Default(rfilter,2) # Default as for MSuper(), ie 2, range=0 -> 4
ml = Float(default(ml,100.0)) # Default as for MFlowInter(), ie 100.0, range=greater than 0.0.
Assert(MaxInterp >= 1 && MaxInterp<=20,"MaxInterp 1 -> 20")
###
CP = c.DeleteFrame(c.Framecount()-1).DuplicateFrame(0)
CN = c.DuplicateFrame(c.Framecount()-1).DeleteFrame(0)
###
ALLNICKS=""" # Define Command mnemonics allowed in command string and file.
CP =1 # CopyFromPrevious (frame n replaced with frame n-1)
CN =2 # CopyFromNext (frame n replaced with frame n+1)
I1 =3:1 # Interpolate 1
I2 =4:2 # Interpolate 2
I3 =6:3 # Interpolate 3
I4 =9:4 # Etc
I5 =13:5 #
I6 =18:6 #
I7 =24:7 #
I8 =31:8 #
I9 =39:9 #
I10=48:10 #
I11=58:11 #
I12=69:12 #
I13=81:13 #
I14=94:14 #
I15=108:15 #
I16=123:16 #
I17=139:17 #
I18=156:18 #
I19=174:19 #
I20=193:20 #
"""
GSCript("""
NICKNAMES="" For(i=0,MaxInterp+2) {NICKNAMES=RT_TxtAddStr(NICKNAMES,RT_TxtGetLine(ALLNICKS,i))}
thSCD1=(8*8)*255 thSCD2=255 BLEND=False bs=(CP.width>960) ? 16 : 8
supFilt = CP.Blur(0.6).MSuper(pel=2,sharp=sharp,rfilter=rfilter,hpad=16, vpad=16)
sup = CP.MSuper(pel=2,sharp=sharp,rfilter=rfilter,hpad=16, vpad=16, levels=1)
For(Bad=1,MaxInterp) {
Eval(RT_String("I%0.2d_bv=supFilt.MAnalyse(isb=true ,delta=%d, blksize=bs, overlap=bs/2)",Bad,Bad+1))
Eval(RT_String("I%0.2d_fv=supFilt.MAnalyse(isb=false,delta=%d, blksize=bs, overlap=bs/2)",Bad,Bad+1))
Eval(RT_String("I%0.2d_bv=MRecalculate(sup,I%0.2d_bv, blksize=bs/2, overlap=bs/4, thSAD=100)",Bad,Bad))
Eval(RT_String("I%0.2d_fv=MRecalculate(sup,I%0.2d_fv, blksize=bs/2, overlap=bs/4, thSAD=100)",Bad,Bad))
for(i=1,Bad) {
Eval(RT_String("I%0.2d_%0.2d=CP.MFlowInter(sup,I%0.2d_bv,I%0.2d_fv,time=100.0*%d/%d,ml=ml,Blend=BLEND,thSCD1=thSCD1,thSCD2=thSCD2)",
\ Bad,i,Bad,Bad,i,Bad+1))
}
}
SSS="c.ClipClop(CP,CN,"
For(i=1,MaxInterp) {S=" \ " for(j=1,i) {S=S+RT_String("I%0.2d_%.02d,",i,j)} SSS=RT_TxtAddStr(SSS,S)}
SSS=RT_TxtAddStr(SSS," \ scmd=SCMD,cmd=CMD,nickname=NICKNAMES,show=SHOW,dv=DV)")
""")
Eval(SSS)
}


Simple client


Avisource("...")

SCMD="""
CP 100 # Copy frame 100 from frame 99
CN 200 # Copy frame 200 from 201
I1 300 # Interpolate frame 300 using 299 and 301 as source frames.
I2 400
I3 500
I4 600
I5 700
I6 800
I7 900
I8 1000
I9 1100
I10 1200
I11 1300 # Interpolate 11 frames at 1300 using frames 1299 and 1300 as source frames.
"""

SetMemoryMax(256)

MaxInterp=15 # Maximum 15 frame interpolations.

DoctorFrames(last, Scmd=SCMD,Show=True, MaxInterp=MaxInterp)

Return Last

StainlessS
20th December 2018, 14:18
I have some issues with your build (actually all builds but your explcitly since is the most up to date).
I get "illegal instruction" message. Using:
Setfiltermtmode("dfttest", 2)
or with/without Prefetch(4), in avs+ x64, so far the only plugin that doesn't work (well wishing SoundOut and ClipClop as well). I'm using libfftw3f-3.dll from fftw338-x64-AVX2 though.

Dogway, you posted above in Avs+ thread just before Pinterf latest release.
What were you replying to, and what has ClipClop got to do with it, thanx.

Dogway
21st December 2018, 02:25
Hello StainlessS, just trying to bring attention to some key plugins still lacking avs+ support in case there were new ways to do things. Just updated to avs+ x64 from avs x86 and I'm still trying to wrap my head around it.

StainlessS
21st December 2018, 08:53
I'll post an update Clipclop soon.
(I actually use x64 ClipClop, forgot it was not upped yet)

StainlessS
22nd December 2018, 12:30
ClipClop v1.26, new version see first post.
Moved to VS2008, Added Version resource, added x64.

Docs in 2 parts, first post has a few lines removed to fit single post.

Part 1 of 2

ClipClop() Range/Frame Replacement Plugins for Avisynth v2.58 and v2.6 x86 & x64, by StainlessS.
Requires VS 2008 CPP Runtimes.


http://forum.doom9.org/showthread.php?t=162266

Planar, YUY2, RGB32, RGB24.

Does NOT affect Audio (as source clip).

Clipclop is a simple plugin to replace ranges in a source clip with the same range, from a replacement clip.
Supports up to 255 replacement clips, with unlimited number of replacements into output clip.


If you wanted to do 1000 single frame replacements in script, that would require 3 trims and 2 splices for each
replaced frame, ie 3000 trims and 2000 splices. This would involve 5000 'zero cost' filters which together will
cost a little more than zero. With ClipClop(), this is reduced to 1 single filter with an overhead of approx
1 trim or splice filter. There is a small overhead setting up the filter (before the very 1st frame is fetched)
while parsing the file/string commands, but then parsing and setting up 5000 trim/splice filters in a script
would not be without cost either. Clipclop can parse in the region of 40,000 commands (from file) in about 1 second
[guessed, based on timing the sister plugin Prune(), a trim/splice plugin].

v1.10, Implements 'Nickname's, Pseudonyms for the replacement clips, ie instead of '17 100,200' you could use eg 'dn 100,200',
in this case it might be to replace frames 100 to 200 of the source clip with the same frames of a denoised clip (clip 17).
OR, 'cp 345' to replace frame 345 with a clip where frame n was copied from frame n-1 of the source clip, ie CopyFromPrevious
[this could be generated via 'SelectEvery(1,-1)', or 'CopyFromNext' clip by 'SelectEvery(1,1)].
Supports Nicknames of up to 31 characters in length so you could use eg 'PredictFromPrevious 1234', or 'FlippedVertical 666,999'.
Nicknames allow you to think in terms of functionality rather than to keep looking up which clip index holds a modified clip
and you could actually write your command file/string before you even know how many clips you need, what clip index they will be,
or even how you will actually create/process the clip.

Once you've tried ClipClop(), you will wonder why you spent all those years doing it the hard way.
(Repeat after me, "I dooo believe in Fairies!".)


DebugView (Highly recommended, allows viewing of info and warnings from the plugin.)
http://technet.microsoft.com/en-gb/sysinternals/bb545027


ClipClop(clip source, clip R1, ... , clip R255, string 'Cmd',string 'SCmd', bool 'Show', bool 'Ver',int 'dv', bool 'NoErr',string "Nickname",bool "Purge")

Compulsory args:

Source, clip, No default [AKA (also known as) R0 in commands].

Rx, clip, No Default
Replacement clips, at least one required,
The first clip R1, up to R255 are supported, 255 clips in all.

Optional args:

Cmd, string, Default= "", Not set.
Command file, use eg "Clop.txt" for command file in your *.avs script directory.

SCmd, string, Default= "", Not set.
Command String, as for command file, but commands supplied in a string rather than a file.

Show bool, Default= false.
true = Show info. v2.6 plugin only required for Show or Ver args with v2.6 colorspace.

ver bool, Default=false.
true = Show version. v2.6 plugin only required for Show or Ver args with v2.6 colorspace.

dv int, Default 0, possible values, 0 - 4 (Out of range values will default to 4==Debug==FULL)
Generates info/warning/error messages during the filter setup stage (before 1st frame is displayed).

0 = No info
1 = Errors sent to DebugView window (Need DebugView Utility)
2 = Warnings & Errors sent to DebugView window
3 = Parsing Info, Warnings & Errors sent to DebugView window.
4 = Debug info, Parsing Info, Warnings & Errors sent to DebugView window (dll Testing, or just for your curiosity).

In DebugView, filter for "ClipClop:" to skip all the extraneous stuff generated by other plugins/programs.
(On "Menu:Edit-Filter/Highlight", and enter "ClipClop:", all ClipClop messages are prefixed by "ClipClop:".

http://technet.microsoft.com/en-gb/sysinternals/bb545027

NoErr, bool, Default false

false = Stop on ANY command error. (usual mode)
You will be informed in DebugView which (if any) errors can be ignored if switched to NoErr==true.

true = Suppress trivial errors where possible.
Only use after you have viewed and dismissed as unimportant any DebugView errors displayed when NoErr==false.
Not all errors are ignorable.

Nickname, String, default "" (not set) [Added v1.10].
Nicknames representing a clip index eg 'cp 37' instead of '5 37'.

Purge, bool, default True. (New v1.20)

False, do not Purge un-used clips.

True (Default), Purge unused clips. Set all un-used clips to NULL within ClipClop, so if they are not used
anywhere else, then clips can be released from memory. Purged clips shown when dv==3 or 4, ie INFO or DEBUG.


Clipclop is a simple plugin to replace ranges in a source clip with the same range,
from a selection of up to 255 replacement clips, unlimited range replacements.
The source clip must be supplied and at least one of the replacement clips must also to be
supplied or it will throw an error.
Also, the replacement clips must be in the same colorspace, same size as the source clip.
If the Rx clips are longer than the source clip, then the framecount will be truncated
to that of the source clip and will not produce an error (the clip itself will not be touched,
the plugin will consider it to have the same frame count as the source).

ClipClop will accept up to 255 replacment (Rx) clips, they are not named
and must follow the source clip. (Hopefully that is enough for those of you who are
very demanding [You know who you are]) ;)
Replacement clips start at R1 and go up to R255.

Either the command file (Cmd) or the Command string (SCmd) must also be supplied, if both
are supplied, the commands in the Command File are processed first followed by those in the
Command String. Where replacements are done more than once, the later one will take effect.


The Command file (Cmd) and the Command String (SCmd) will have a series of ranges to 'clop'
(ie replace) and will have the below format.

Rx(s,e)


Where the 'R' is optional and can be omitted.

where x is the replacement clip index number eg R7 is replacement clip 7, (the first one is R1).

Where the '(' and ')' are optional and if skipped then the opening '(' must be replaced by Comma ',' or ' ' (SPACE).

Where the ',' (COMMA) can be replaced with a ' ' (SPACE) [only needed if 'e' is specified].

Where the ')' is strictly speaking, unnecessary, whether the '(' is used or not.

s is the start frame and MUST be supplied.

e is optional and if missing, then the range will consist of only 1 frame.

If e=0, then the range will continue to the last frame of the REPLACEMENT CLIP (Rx) , it will not
produce an error if the replacement clip is shorter than the source clip. (would be limited to the
length of the shorter clip, either source or replacement).

If e is -ve (negative) then it will represent a -ve frame count eg -2 means 2 frames.

These are all valid:

R1 (35,42) # This is a comment
R1 65 374
2 1000
3 3700 5000
4 (36734,0) # My helicopter is full of penguins
5,23644,-3
R6,20,30)
R6(56,123

If the command file contained the above commands then clips R1 to R6 have all to be supplied to ClipClop.

The Cmd file commands MUST be line separated (ie one command per line).

The SCmd commands can be either Line Separated as the CMD commands or use a ';' SEMICOLON separator, as in

SCMD="R1(35,42) # My Zeppelin is full of lead ; R1 65 374
R2,1000,1200; R2(1400,1500)
R3(2000,-100) # My Spaceship is replete with aardvarks"


In SCmd, A SEMICOLON ';' would NOT be acceptable in a COMMENT, it would signify a new line and command pending
(ie PARSE error, it would look for a command following the ';').

R0 can be used in the commands to mean replace with the source clip, might be of use to reset
parts of a replaced range, back to how it originally was before previous clopping. Might be useful where
eg denoised clip used to replace a range, produced several unacceptable frames that need to be restored from
the original source.

-----------------------

StainlessS
22nd December 2018, 12:31
Part 2 of 2


v1.10, Nickname string is roughly the same format as SCMD, SEMICOLON (;) separated if on same line
or line separated, and can also contain comments. A Nickname, MUST start with either an underscore ('_'),
or an Alphabetic character ('A' -> 'Z' or 'a' -> 'z'). The remainder of the nickname can contain underscore,
alphabetic or numeric ('0' - '9') characters, as in "_Testing_123_Testing" or "AnyOldName_432" or "Fred".
The length limit on Nicknames is 31 characters.
There are a set of RESERVED names that CANNOT be redefined by Nickname, "Rnnn" or "rnnn" where 'nnn' represents
1 or more numeric digits. In a command file/string, you can use eg "R0" (or '0') to refer to the source clip and "R1"
to "R255" (or '1' to '255') to refer to the replacement clips whether or not they have nicknames applied.
As well as "(", "," and SPACE " " separators, a nickname allows "=". Below some valid examples:-

NickName = "
CopyFromPrevious=1 # Comment ; PredictFromNext,2 # another comment ; DN 3
CO=4
ZX(5)
QP (6)
XXX 7 # Patient: My hand hurts when I do this. ; ttt = 8 # Doctor: Then stop doing that!
ds123dgsdg__dld 9
ww(10
yy=11)
"

Nicknames do not have to be in ascending order, but might be best to keep them that way.

Using above Nickname example,

"dn 2000,3000" would replace source frames 2000 to 3000 with clip 3 frames 2000 to 3000, when used in a command
file or command string. Nicknames are case insignificant ('A' == 'a').

----------------------

If NoErr is true, then the plugin will try to avoid throwing an error for 'suspect' commands, not all
errors will be ignored.
Commands that do not fit in the valid formats described above will not be ignored (PARSE error).
-ve start frame will not be ignored (PARSE error, it could be clipped to 0, but I REFUSE to allow it).
If an Rx clip has been omitted (missed out) then all Rx commands can be ignored.
If a range fully or partially falls outside of either the source or Rx clips, then those can
be ignored (invalid part of the range).



It is recommended that you DO use the linked DebugView utility, to check out warnings,
ClipClop() will try to warn you if you need to re-evaluate your,,, evaluations.
It will warn of things like source and replacement clips being of different number of frames,
there is no need to be alarmed by the NoErr option, you do not have to use it.
Dont always use NoErr = true, unless you really really know what you
are doing [or your name is 'Cretindesalpes' :) ].

---------------------------------------------------------------------------------------------
Almost all of the hard work of ClipClop is done during setting up the filter. During the rendering
stage, ClipClop() does not do anything terribly clever, it just selects the frame to use from a
pre-calculated array or uses the source frame instead, but what it does do, it does fast as possible.
How can ClipClop be used, well if your source is mostly OK, but one range needs some sort of denoising,
and another range needs color correction and a third needs both, then you could eg create a denoised clip,
and create a color corrected clip, and a third with both denoising and color correction and
specify the ranges to 'clop' with the altered clips, Only the ranges that are actually
used with have the denoising/color correction done, and the source clip will be used most
of the time and those parts will be very fast.

Be warned, if you create a replacement clip using some ULTRA slow motion compensated function and eg
replace 1 in 10 frames then it will fly like the wind for 9 frames and jerk to an almost halt for 1, repeatedly,
this is not a problem in ClipClop(), it cannot make your ULTRA slow function go faster (It will be a little
disturbing if you do that but you could always use eg "AssumeFPS(0.001)" to smooth out the jerks it might however
take a little longer :)

---------------------------------------------------------------------------------------------

GetParity is implemented in the plugin as requested by Cretindesalpes (Thanks).

---------------------------------------------------------------------------------------------

Sister, Trim/splice plugin Prune() [v1.10 with Nicknames too].

http://forum.doom9.org/showthread.php?t=162446


---------------------------------------------------------------------------------------------

v1.20, NickName's are extended to allow MAGIC CLIPS.
Magic clips are handled more strictly and cannot be overwritten or redefined, and also cannot be used with a clip range,
the range (or more specifically the number of clips [or frames]) is fixed in the NickName definition of the Magic Clip.
Magic clips were added for a particular application and it is not expected that you will want to use them yourself,
the application is included in the AVS folder by name DoctorFrames.avs.
A Magic Clip is a series of associated clips which are treated as a special group, the number of clips in the group is
indicated by being preceded by a colon (':').
In NickName string,

NICKNAME="""
I3=6:3 # Interpolate 3 frames. Clips start at index 6, 3 clip group. Clip index's 6 to 6 + 3 - 1.
"""

In above case, the Magic group starts at clip 6 and consists of 3 clips (ie clip 6 to clip 8).
With a command of "I3 100" in either Cmd file or SCmd string,
Source_Frame Replaced_With
R0(100) R6(100)
R0(101) R7(100)
R0(102) R8(100)

You must use the NickName to do Magic Clip replacement, you cannot eg specify in SCMD "6 100", you must use eg "I3 100".
You cannot overwrite a Magic Clip replacement, it will produce an error.

---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------

Example usage script using NickNames:
###
Avisource("D:\avs\test.avi")
ORG=Last

V1 = FFT3DFilter(Plane=0,Sigma=1.6) # Light Luma
V2 = FFT3DFilter(Plane=0,Sigma=2.0) # Med Luma
V3 = FFT3DFilter(Plane=0,Sigma=4.0) # High Luma
V4 = FFT3DFilter(Plane=3,Sigma=1.6) # Light Chroma
V5 = FFT3DFilter(Plane=3,Sigma=2.0) # Med Chroma
V6 = FFT3DFilter(Plane=3,Sigma=4.0) # High Chroma
V7 = FFT3DFilter(Plane=4,Sigma=1.6) # Light Luma+Chroma
V8 = FFT3DFilter(Plane=4,Sigma=2.0) # Med Luma+Chroma
V9 = FFT3DFilter(Plane=4,Sigma=4.0) # High Luma+Chroma
V10= FlipHorizontal() # Flip-H
V11= FlipVertical() # Flip-V
V12= Invert() # Invert

NickNames =""" # Psuedonyms for clips (clip index number)
L0 = 1 # Light Luma
L1 = 2 # Med Luma
L2 = 3 # High Luma
C0 = 4 # Light Chroma
C1 = 5 # Med Chroma
C2 = 6 # High Chroma
LC0 = 7 # Light Luma + Chroma
LC1 = 8 # Med Luma + Chroma
LC2 = 9 # High Luma + Chroma
FH = 10 # Flip-H
FV = 11 # Flip-V
INV = 12 # Invert
"""

SCMD=""" # Clip editing commands in string, can also use commands in file
C0 0,99 # Light Chroma frames @ 0 -> 99
L0 100,-200 # Light Luma frames @ 100, 200 frames ie frames 100->299
INV 300,399 # Invert 300->399
L0 400,499 # Light Luma frames 400->499
FH 500,599 # Flip-H 500->599
LC2 600,699 # High Luma + Chroma
C1 800 # Med Chroma, Single frame
1 900,999 # Light Luma, We used the clip number instead of a NickName
FV 1000,1099 # Flip-V
LC1 2000,0 # Med Luma + Chroma, 2000 -> lastframe
"""

SHOW=True

ClipClop(ORG,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,scmd=SCMD,nickname=NickNames,show=SHOW)

---------------------------------------------------------------------------------------------
StainlessS.



EDIT: DoctorFrames script is temp removed from curent version and may be replaced in some future version.

Dogway
23rd December 2018, 12:01
Thanks for the update, IMO it's a basic tool for edit filtering.

StainlessS
27th July 2021, 21:34
ClipClop v1.27, see 1st post.
[Available only on MediaFire in sig below this post, having problems getting into my SendSpace account].


02/Nov/2017 - ver 1.25 - Recompile vs 2008
27/Oct/2018 - ver 1.26 - Add x64.
27/Jul/2021 - ver 1.27 - Add HBD text render [Show/Ver] using DDigit v2.0.


Would previously work just fine with HBD clips, except where Show = true OR Ver = True, ie printing metrics text on frame.