Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th April 2017, 19:52   #201  |  Link
fieliapm
Himawari Tachibana
 
fieliapm's Avatar
 
Join Date: Nov 2013
Location: Taipei, Taiwan
Posts: 8
There is new version of VideoInputSource:

discussion

binary

source

Everyone can use it to grab video frame from video capture card or webcam in real-time
fieliapm is offline   Reply With Quote
Old 14th April 2017, 00:33   #202  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
FredAverage().
A simple average filter for Avisynth v2.6 standard colorspaces, only.
Returns a clip where each return frame is a single color average of input frame, same size and colorspace as input.
Does an invert on result if Bool Invert==true.

Code:
FredAverage, (not to be confused with RedAverage).

Avisynth v2.6 only plugin.

ColorSpace, YV12, YV16, YV24, YV411, Y8, YUY2, RGB24, RGB32, only.

Return clip Y, U and V, or R, G and B, will be channel averages, unless Invert==True, where channels averages will be inverted. 

FredAverage(clip c, Bool "Invert"=false)

Invert,      Default false == sampled average. Otherwise Inverted average.

Returns clip same colorspace and size as input.
See home thread here:- https://forum.doom9.org/showthread.php?t=174520
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 16th April 2017, 18:09   #203  |  Link
fieliapm
Himawari Tachibana
 
fieliapm's Avatar
 
Join Date: Nov 2013
Location: Taipei, Taiwan
Posts: 8
avsi4comp - some utility functions help video editing/compositing easily in AviSynth
Not well documented yet, but example scripts in example directory show that how to use them.

It is compatible with AviSynth 2.5x,2.6x,and AviSynth+
fieliapm is offline   Reply With Quote
Old 7th June 2017, 20:23   #204  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
StrFmt,

Simple plugin to produce formatted string, and additional function to string replace with another string.

Code:
StrFmt(String format, dat1,...,datn)

 Returns a formatted string. The unnamed 'format' string and optional unnamed 'dat' args are used to construct the text string that is
 returned, uses C/CPP printf() style formatting.
 Format: compulsory string controlling format and describing the datn type args that are expected.
 datn: Variable number of data args of any type (excluding clip).

 printf Format spec here:- http://msdn.microsoft.com/en-us/libr...=vs.71%29.aspx
  NOTE, the only support for printing Bool variables is %s as string, ie prints "True" or "False".

 Formatting supported, %[flags] [width] [.precision] type

  flags, one of  "-,+,0, ,#"
  width, integer, "*" supported (width supplied via dat arg).
  Precision, integer, "*" supported (precision supplied via dat arg).
  type,
    "c,C,d,i,o,u,x,X",  Integer type, c,C=character, d,i=signed, o,u,x,X=unsigned (o=octal, x=Hex).
    "e,E,f,g,G",        Floating point type
    "s,S",              String type (also Bool).

  Formatting Insertion point is marked with '%' character in the format string (as in Avisynth String function), if you wish to use
  a percent character within the returned string, it should be inserted twice in the format string ie '%%' will produce a single '%'.
  The data datn arg strings do not require a double '%' character.

  A Backslash character '\' introduces escape sequences, to insert a backslash character itself, you must supply a double
  backslash sequence ie '\\'.
  Converts embedded escape character sequences (Case Significant):-
    '\\' Converted to '\'       Single Backslash
    '\n' Converted to Chr(10)   NewLine
    '\r' Converted to Chr(13)   Carriage Return
    '\t' Converted to Chr(9)    Horizontal TAB
    '\v' Converted to Chr(11)   Vertical TAB
    '\f' Converted to Chr(12)   FormFeed
    '\b' Converted to Chr(8)    BackSpace
    '\a' Converted to Chr(7)    Bell
    '\x', where x is ANY OTHER CHARACTER not included above, will be copied verbatim, ie '\x'.

  eg
   StrFmt("Hello there %s and %s.\nGoodbye %d.","Fred","Ted",2013)
   would return same as:-   "Hello there Fred and Ted." + Chr(10) + "Goodbye 2013."

*****
*****
*****

StrRep(string source,string find,string replace,bool "sig"=True) # Based on Algorithm by Vampiredom, Gavino & IanB.
 String args 'source', 'find' and 'replace' unnamed and compulsory.
 Takes a source string, searches for all occurences of find string and replaces the found strings with the replace string.
 Can use "" in replace string (only in replace) to delete the found substrings from the source string.
 Newlines are treated no differently to other characters, and could be replaced/deleted.
 'sig' arg,default true is Case Significant. Set false for case insignificant find string.
See home thread here:- http://forum.doom9.org/showthread.php?t=174649
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 13th June 2017 at 00:30.
StainlessS is offline   Reply With Quote
Old 16th January 2018, 05:06   #205  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
can this https://github.com/DmitryUlyanov/deep-image-prior be avs/avs+ plugin?

it look interesting
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 21st January 2018, 20:58   #206  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
FrameStore v0.01 - Avs+ x86/x64

FrameStore_ReadMe.txt
Code:
FrameStore(clip c)   # by StainlessS
Requires VS 2008 runtimes.

An Avisynth v2.6, Filter to both take and produce a single frame.
All standard AVS+ v2.6 Colorspaces.

The function creates a store for FRAME 0 of the input clip c.
The function is intended to sever the link between a frame and any clips that it is reliant upon.



A=Colorbars.trim(0,-1)      # 1 frame
B=A.FlipVertical            # B is reliant upon clip A
C=A.Overlay(B,Opacity=0.5)  # C is reliant upon clips A and B

D=C.FrameStore # D is not reliant upon A, or B, or C.

return D
https://forum.doom9.org/showthread.p...46#post1831346
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 2nd February 2018, 20:31   #207  |  Link
introspected
Registered User
 
Join Date: Nov 2017
Posts: 35
AutoOverlay - new plugin to auto-align two clips in different modes with histogram matching: https://github.com/introspected/AutoOverlay
Discussion

Last edited by introspected; 3rd February 2018 at 07:42.
introspected is offline   Reply With Quote
Old 24th March 2018, 10:30   #208  |  Link
`Orum
Registered User
 
Join Date: Sep 2005
Posts: 178
DupStep, a frame deduplicator (CFR to VFR conversion; eventually will support VFR to VFR). Similar to other filters like DeDup, but adds support for things they don't have (e.g. deep color). It can also emulate other filters perfectly given certain parameter restrictions, e.g. ExactDedup(_keeplastframe=true). Supports only 64-bit environments.
__________________
My filters: DupStep | PointSize

Last edited by `Orum; 24th March 2018 at 10:34.
`Orum is offline   Reply With Quote
Old 1st April 2018, 22:20   #209  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
New Script function, Duplicity() v1.01,

Code:
    Duplicity(), by StainlessS @ Doom9.
        A two faced scheming and double dealing [on your behalf] de-dupe tool. [writes duplicate frame number/ranges to Frames file].

    Req RT_Stats v1.43 + CallCmd (c) StainlessS, + GSCript + Grunt (c) Gavino.
    [GScript not needed if Avs+, Will Not AutoDelete DBase if CallCmd not available]

    Avs 2.6 Planar, YUY2, RGB24/32 (RGB converted to Luma-Y using Matrix arg, defaults to PC levels 601/709 based on Width & Height).

        DeDuppers use some method to determine if a frame is a duplicate of its predecessor, a typical measuring method might be
    LumaDifference (average absolute luma difference per pixel), unfortunately the result of such measure may be due to a small
    frame global change (lots and lots of pixels change by a small amount), or a smaller number of pixels change by a
    larger amount, both these cases could produce the exact same result. Another case may be that of a very small number of
    pixels change by a very large amount (eg a person closing a fist with remainder of frame static) and such measure might seem
    to be a duplicate as it could produce much smaller numbers than a frame global change of a small amount.

        Duplicity() uses a double measurement system, Primary measurement (LumaDifference) to detect frames 'Unique' to their immediate
    predecessor (large or 'frame Global' changes), and a Secondary method to determine if 'Non-Unique' frames are either 'Low Motion'
    or 'Duplicate' frames. This second measurement method is LumaPixelsDifferent (result 0.0->255.0 where 255.0 is equivalent to
    100.0%, user args for this method actually require Duplicity arg 'IgnorePercL' in range 0.0->100.0%).
    LumaPixelsDifferent(as far as this dupe function is concerned), compares frames and shows percent of pixels whose
    corresponding pixel absolute luma difference is greater than Int arg 'ThL', if this percent difference is greater than 'IgnorePercL',
    then it is deemed to be a 'Low motion' frame and if less or equal to 'IgnorePercL' then is a duplicate ('IgnorePercL' can be
    0.0, meaning any pixels at all with difference greater than 'ThL' is a 'Low Motion' Frame). Where both 'ThL' and 'IgnorePercL'
    are 0 and 0.0 respectively, will show percentage of pixels that are not Exactly the same. 'IgnorePercL' could be set to 0.0
    in which case the function is governed soley by any pixel differences exceeding 'ThL', or can set 'IgnorePercL'= eg 0.001%
    meaning the it will disregard as noise 1 pixel difference exceeding 'ThL' in every 100,000 pixels [eg 1 pixel in every
    316x316 region].

        The function determines if the current frame is a 'Unique' frame or not (via 'ThG' LumaDifference to predecessor), if Unique,
    then the job is done and is considered a Non-Duplicate, these Unique frames are marked in a DBase as Unique. If a frame is
    'Non-Unique', then the function scans both backwards and forwards looking for 'Unique Start' and 'Unique End' frames (and if
    necessary, marking them in DBase). This Backwards/Forwards scanning permits jumping around in the clip for perusal and getting
    exact same results as if travelling forwards only (even backwards traversal only, should work just fine). When the
    'Unique Start' and 'Unique End' frames are established, we then know the extent of the unknown (unvisited) frames, and can scan
    and measure those with the second measurement method (LumaPixelsDifferent) to determine Low Motion/Dupe status.
    When determining Low Motion/Dupe status, we compare with an 'Anchor Frame', which at the beginning of a 'Non-Unique' sequence
    is the 'Unique Start' frame. When scanning a Duplicate sequence the 'Anchor Frame' is the predecessor frame to the very first
    duplicate in the current sub sequence of the 'Non-Unique' sequence, so potential duplicates are not necessarily compared with
    their immediate predecessor. When a frame is determined to be 'Low Motion' (not a dupe), any detected duplcates are written to
    the DBase and also to the output Frames file, and it switches to detecting sequences of 'Low Motion' frames within the
    'Non-Unique' sequence. On each detected 'Low Motion' frame, the Anchor frame for the next frame (whether it be another
    'Low Motion' frame or a new 'Dupe' frame) will be switched to that newly detected 'Low Motion' frame. With this method,
    all frames BETWEEN (but excluding) the 'Unique Start' and 'Unique End' in the 'Non-Unique' sequence are detected as perhaps
    multiple 'Low Motion' and 'Duplicate' sub sequences.
      Setting LagMax arg to some low number (min 1), will limit distance of the Anchor frame prior to the current frame, eg setting
    LagMax=1, would always do LoMo/Dupe compare with the current frame and its predecessor.

      Although you might be able to scan backwards and get same detections, results are written to file in visited sequence and
    you should NOT jump about whilst writing the final frames file. Also, this is a Multi-Instance script, can use multiple instances
    at the same time (view side by side metrics) but you should really choose a unique 'Frames' filename for each instance.
https://forum.doom9.org/showthread.php?t=175357
EDIT: Update to v1.01.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 2nd April 2018 at 00:01.
StainlessS is offline   Reply With Quote
Old 28th April 2018, 14:57   #210  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
FDecimate2 v2.00 - 28 Apr 2018

FDecimate2, mod of FDecimate v1.02.
FDecimate2, fixes some problems with bugged metrics in FDecimate v1.02.
EDIT: Also adds support for RGB32/24 and 8 bit v2.60 Planar colorspaces.

Dll's for Avisynth v2.58 x86, v2.60 x86 and x64.

Here:- https://forum.doom9.org/showthread.p...57#post1840557
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 28th April 2018 at 15:44.
StainlessS is offline   Reply With Quote
Old 1st May 2018, 20:00   #211  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
New Script Functions, Trog and WDG. For Reducing Grain.
Requires RGTools, Median, DFTTest, and UU_MT_Blend.

Code:
function trog(clip v,int "tr",bool "push")
{###(c) MWilson 2018
tr=default(tr,12)
push=default(push,true)
v=v.converttoyv12()
repair(v.temporalmedian(tr,true),v,18,18,18)
return (push==true) ? repair(last.m10(),last,18,18,18) : last
}

function wdg(clip v,int "sigma")
{###(c) MWilson 2018
sigma=default(sigma,32)
v=v.converttoyv12()
grainreduced=v.dfttest(sigma=sigma)
mask=merge(v,grainreduced.Invert())
darkened=mask.coloryuv(cont_y=768)
darkened.temporalmedian(1,true).m10()
coloryuv(cont_y=-127)
grainmask=last
return uu_mt_blend(grainreduced,grainmask,1,"gmerge",3)
}

function m10 (clip y)
{###(c) MWilson 2018
y=y.converttoyv12()
a1=y.trim(1,-0)
a2=y.trim(2,-0)
a3=y.trim(3,-0)
a4=y.trim(4,-0)
a5=y.trim(5,-0)
a6=y.trim(6,-0)
a7=y.trim(7,-0)
a8=y.trim(8,-0)
a9=y.trim(9,-0)
a10=y.trim(10,-0)
merge(a10,a9,.05)
merge(last,a8,.1)
merge(last,a7,.15)
merge(last,a6,.2)
merge(last,a5,.25)
merge(last,a4,.3)
merge(last,a3,.35)
merge(last,a2,.4)
merge(last,a1,.45)
merge(last,y,.5)
c=last
return c
}
__________________
ChromaJig

Last edited by MWilson; 1st May 2018 at 20:05. Reason: Forgot a requirement
MWilson is offline   Reply With Quote
Old 2nd June 2018, 19:55   #212  |  Link
ifb
Registered User
 
Join Date: Dec 2009
Posts: 72
Color Bars

Probably not worth it's own thread, but I made a bar generator for VapourSynth. NTSC on up to 8K is supported with SDR/HDR (HLG, PQ) and 709/2020 primaries.

ColorBars is a filter for generating test signals. The output is a single frame of color bars according to SMPTE RP 219-1, 219-2, or ITU-R BT.2111-0. For NTSC, the bar pattern is described in SMPTE EG 1. For PAL, EBU bars are generated.

https://github.com/ifb/vapoursynth-colorbars
ifb is offline   Reply With Quote
Old 2nd June 2018, 22:20   #213  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Sweet, that will come in handy. Thanks for your work, ifb.

Last edited by videoh; 2nd June 2018 at 22:23.
videoh is offline   Reply With Quote
Old 24th July 2018, 16:03   #214  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ForceProcess v1.00 - 24 July 2018

A standalone drop in replacement for RT_Stats v2.0(currently Beta11) RT_ForceProcess().

Code:
ForceProcess(), v1.00, By StainlessS @ Doom9

Requires VS2008 CPP runtimes,

ForceProcess(clip, bool "Video"=True,bool "Audio"=false,Bool "Debug"=True) :- Returns 0


If Video (default true),  Force read every frame of clip from 0 to FrameCount-1.
If Audio (default false), Force read every sample of clip from 0 to NumberOfSamples-1.
Useful where a clip outputs some kind of file for use in a second filter, this function would in such a case
forcibly read and therefore write the file, so that it may be available to other filters or to a second pass of  the filter that
initially wrote the file.
Debug, default true. Write Progress to DebugView.

The ForceProcess function forcibly processes both video and audio streams (ie reads each frame/sample in sequence),
so that any eg log files produced by either video and/or audio processing filter will be forcibly written to disk.
ForceProcess is a runtime function not filter and so only returns on completion.

Example:

    Two Pass:

        WhateverSource(...)
        A_Two_Pass_Function(Pass=1) # Create some kind of deshaker log or whatever.
        ForceProcess()              # Force Pass 1, creating log
        A_Two_Pass_Function(Pass=2) # Use created log
        return Last
https://forum.doom9.org/showthread.php?t=175616
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 27th August 2018, 02:04   #215  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
pixelscope v0.1

pixelscope, a debugging filter to display pixel values.

https://forum.doom9.org/showthread.php?p=1849850

__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 27th August 2018 at 02:18.
wonkey_monkey is offline   Reply With Quote
Old 2nd September 2018, 19:51   #216  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
DirtBox_MI_v0.03.avs New filter.

Fixes damage like this (two consecutive damaged frames, left fixed with metrics, right bad source, middle Zebra dc detection clip)


Frame Before Bad Frames pair [showing LHS detection metric of 4.598, and hilited 'L' flag denoting left Source frame for interpolation]

First of bad frame pair

Second of bad frame pair

Frame after bad frame pair [showing RHS detection metric of 2.303, and hilited 'R' flag denoting right Source frame for interpolation]

(Above top frame, LHS detection [left of damage detection is shown in the rhs metric], the damage is to the right, bottom frame RHS detection, the damage is to the left)

Or Flash Frame Photography (static or near static cam), where Th arg might want to be somewhat bigger.
Adjust Th setting by viewing RHS RAT metrics on frame before bad frames, so that it is below the lowest bad frame metrcs ratio.

Code:
    DirtBox_MI(), v0.03

        [ Take your time saying the name out aloud when in public place ].

        Req:- GScript OR Avs+, Grunt, MvTools2, Masktools2, RemoveGrain, CallCmd, RT_Stats v1.43.
              CallCmd() optional, will auto delete DBase on clip closure if present.
        YUV Only (well whatever MvTools2 + MaskTools2 supports).

    Function DirtBox_MI(clip c,clip "dc"=c,Float "Th"=1.3,Float "ThMin"=0.5,Int "MinLen=1",Int "MaxLen"=2,
        \ Int "SPad"=16, Int "SSharp"=1, Int "SRFilter"=4,                             [* MSuper          *]
        \ Int "ABlkSize"=16, Int "AOverlap"=4,   Int "ASearch"=3,Int "ADct"=0,         [* MAnalyse        *]
        \ Int "RBlkSize"=8,  Int "ROverlap"=2,   Int "RthSAD"=100,                     [* MRecalculate    *]
        \ Float "Iml"=200.0, Bool "IBlend"=True, Int "IthSCD1"=400, Int "IthSCD2"=130, [* MFlowInter      *]
        \ Int "OthSCD1"=400,Int "OthSCD2"=130,                                         [* Detect Override *]
        \ bool "Show",Int "Chop",String "SurgeonFile",String "OverrideFile"
        \ )

    Args:-
        c,             Source clip.
        dc,            Detection Clip, Default c. Must have same number of frames as Src c, no other requirement.
                       Intent to use eg Zebra Bands to better tune for detection, Used only for primary detect of
                       leftmost and rightmost frames where damage occurs.

        Th,            Bad Ratio Threshold, default 1.3. If eg Cur->Nxt / Max(Prv->Cur,0.001) > Th then Nxt
                       frame is possble 1st of damaged frames (but Cur->Nxt must also be >= ThMin as described below).
                       Suggest much higher for flash frame detection (probably dont need Zebra dc clip)..
                       Default Th of 1.3 is VERY sensitive, take care with this setting, it could well chew up your
                       prized video clip.
        ThMin,         Difference of Cur->Nxt must be at least this to detect Left 'breakup'. default 0.5.
                       (Avoid detection where current frame is a duplicate of prev frame and Cur->Nxt diff is very small.)
                       [Same in reverse for detecting RHS breakup]. Do Not set to 0.0, ie OFF.

        MinLen,        Minimum length of damaged sequence to fix, default 1.
        MaxLen,        Maximum length of damaged sequence to fix, default 2 (1 <= MinLen <= MaxLen <= 9).
                       MaxLen provides the maximum supported by the FrameSurgeon script, ie 9, and so will not be
                       increased further.
                         Suggest only use MaxLen of 9 where Th is really quite high, bare minimum of maybe 5.0 or
                       perhaps even 10.0, even then is probably a bit dodgy.

                       MSuper args:
        SPad,          Default 16,   See MvTools MSuper(hpad=8,vpad=8) [We use same for both].
        SSharp,        Default  1,   See MvTools MSuper(sharp=2)
        SRFilter,      Default  4,   See MvTools MSuper(rfilter=2)

                       MAnalyse args:
        ABlkSize,      Default 16,   See MvTools MAnalyse(BlkSize=8,BlkSizeV=8) [We use same for both].
        AOverLap,      Default  4,   See MvTools MAnalyse(OverLap=0)
        ASearch,       Default  3,   See MvTools MAnalyse(Search=4)
        ADct,          Default  0,   See MvTools MAnalyse(Dct=0). Using other than default value can be VERY slow.

                       MRecalculate args:
        RBlkSize,      Default   8,   See MvTools MRecalculate(BlkSize)
                         NOTE, RBlkSize = 0 Will Switch OFF MRecalculate, probably a bit faster at possible expense of quality.
        ROverlap,      Default   2,   See MvTools MRecalculate(Overlap)
        RthSAD,        Default 100, See MvTools MRecalculate(thSAD=200)

                       MFlowInter args:
        Iml,           Default 200.0, See MvTools MFlowInter(ml=100.0)
        IBlend,        Default True,  See MvTools MFlowInter(Blend=True). Blend or copy frame at scene change.
        IthSCD1,       Default 400,   See MvTools MFlowInter(thSCD1=400) :  (0 < IthSCD1 <= (8*8)*255)
        IthSCD2,       Default 130,   See MvTools MFlowInter(thSCD2=130) :  (0 < IthSCD2 <= 255)
                       Threshold which sets how many blocks have to change for the frame to be considered as a
                       scene change. It is ranged from 0 to 255, 0 meaning 0 %, 255 meaning 100 %.
                       Default is 130 (which means 51.0%).
                       Used by MvTools2 MFlowInter during interpolation.

                       Detection Override args:
        OthSCD1,       Default 400. as MVTools MSCDetection arg. (0 < OthSCD1 <= (8*8)*255). See MvTools2.
        OthSCD2,       Default 130. as MVTools MSCDetection arg. (0 < OthSCD2 <= 255)
                           These two thresholds govern whether frames either side of bad sequence are determined to be
                       from the same scene, if not from Same scene then detection is Overidden and 'E' flag is set in metrics,
                       on what would have been the 1st/leftmost interpolation Source frame.
                       NOTE, If OthSCD1 > 8*8*255 or OthSCD2 > 255 then switches OFF scene change testing, will NOT override
                       any detections that seem to have good frames either end from different scenes. (will likely
                       result in blended scene transitions).

                       Metrics Args:
        Show,          Show Metrics, default True.
        Chop,          Show Mode if Show=True,
                         0 Normal
                         1 Left half of frame is fixed, Right original.
                         2 Top half of frame is fixed, Bottom original.

                       File Output args:
        SurgeonFile,   Default "FrameSurgeonCmd.txt". If Non "", then writes a FrameSurgeon() command file to
                       recreate result, so can manually edit the result file and re-render in FrameSurgeon.
                       [part of the Sawbones/FrameSurgeon combo which also requires ClipClop()].
                       If using Multi-instances, each instance should have its own SurgeonFile file.

        OverrideFile,  Default "Overridden.txt". Detected Sequences that were Overridden because the interpolation
                       source frames seemed to be from Different scenes
                       [In FrameSurgeon() format,
                       "I2 666" would be two frame bad seq starting at frame 666, where interp src frames would have
                       been frames 665 and 668].

        Dc clip implemented to assist in detection, where can use eg Zebra() to create a 'tuned to error' diagnostic clip.
        Most damage will likely occur horizontally (in eg VHS tracking gunk), and so we might use Zebra Default Row=true
        to create a vertical set of Zebra bars (same height as clip c), and can use the Zebra args, Threshold, Lo and Hi,
        to tune some of the bars to better reveal where errors occur. If any of the bars seem of no use, then best
        get rid of those bars (crop) so as not to 'water down' the detection metrics.
          May be able to detect several kinds of frame corruption, including flash frames, up to 9 frames catered for.
        Where it can detect flash frames, will only likely be possible where frames are from the SAME SCENE, not two
        different scenes separated by white gunk.
        Dc clip probably not needed for flash photography flashes.
        To deal with Interlaced clip, can eg SeparateFields  / SelectEven/Odd and handle each separately, then weave them
        back together again afterwards. Is multi-instance capable and so (despite use of global vars) will work just fine.
        Probably better to not jump about, jumping into middle of bad sequence will start detect from jump point,
        but OK to go backwards where already visited.

        Shows Flags where hi-lited,
            E = End Of Scene
                Shown only on 1st detected Interpolation Src frame (frame before bad sequence starts).
                Override where detected bad seq interpolation source frames are NOT from same scene (by OthSCD1 and OthSCD2)
            0 = Any Digit 0 to 9, 0 when E flag not hi-lited, else digit representing length of bad sequence
                that was Overridden as for E flag above.
            L = Left Intep Src frame
            R = Right Interpolate Src frame,
            * = Interpolated frame.
Here:- https://forum.doom9.org/showthread.php?t=175708
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 5th September 2018 at 13:03.
StainlessS is offline   Reply With Quote
Old 14th January 2019, 19:21   #217  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RandomSource(), Simple source filter prodcing RGB32 640x480@24 FPS clip by default, random colored for test purposes.

dll's for avs v2.58, Avs/+ v2.60 x86 & x64.
Requires VS2008 CPP Runtimes,
Here:- https://forum.doom9.org/showthread.p...44#post1862844

__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 14th January 2019, 20:42   #218  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
warp, a filter to correct or distort video geometry using control points. Also includes a new version of quad.

https://forum.doom9.org/showthread.php?p=1862853

Demo/tutorial video: https://www.youtube.com/watch?v=SG1eex7HmLM

__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 14th January 2019 at 20:45.
wonkey_monkey is offline   Reply With Quote
Old 4th February 2019, 02:21   #219  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
TitleBar, v1.02, new plug.

Code:
TitleBar() - by StainlessS @ Doom9:- https://forum.doom9.org/showthread.php?t=176062

Requires VS2008 CPP Runtimes.

VIDEO: Planar, YUY2, RGB32, & RGB24.

Plugin's for both Avisynth v2.58 and v2.6 (avs+ x86 & x64).

Filter to Add a 20 pixel Black TitleBar to top of clip, and to write a title string and optional Frame Number to each frame.
Uses DDigit text renderer & where showing FrameNumber, does not require ScriptClip() filter call.

    Titlebar(clip c,String "Tit"="",Bool "ShowFrameNo"=True,Int "Col"=$000000,String "ColChr"="",Bool "Esc"=True)

    Tit,           Default "", Title string to write above video clip to the TitleBar.
                       The Tit title string may also contain Escape codes if Esc Arg is True, see later.

    ShowFrameNo,   Default True. If True, then also writes Frame Number as in eg "1234] My Title String".

    Col,           Default $000000. RGB color of the TitleBar background.

    ColChr,        Default "" (Starting Color = default). A single character as a string which sets the Starting color used for printing the FrameNumber/Title text.
                       If the ColChr string contains more than a single character, it will throw an error.
                       Valid single character can be any one of these (upper or lower case):-
                            "0123456789ABCDEF"   # 16 Color character codes '0' to 'F'
                            "GHIJKLMNOPQRSTUV"   # 16 Greyscale character codes in ascending order of lightness 'G' to 'V' ($00 -> $FF)
                            "-!*"                # 3 Specials,
                                                 #   '-' = Default color. : As '7' [White]  in Color colorspace : As 'S' [Near white $CC] in Y8.
                                                 #   '!' = HiLite color.  : As 'A' [Orange] in Color colorspace : As 'V' [White $FF] in Y8.
                                                 #   '*' = Silently converted to '-', ie Default color. (Only has real meaning embedded in the Tit title string).

    Esc,           Default True. If True, then Escape codes "\a?", and "\x??" can be used to embed data into Tit Title string (The 'a' and 'x' MUST BE LOWERCASE).
                       Where "\a?", '?' is any character valid as in above ColChr, enables changing color on title bar, within the Tit title string.
                            In such a case, "\a*" switches to the OnEntry or Starting color, ie same color as set via ColChr.
                       Where "\x??", each '?' character MUST BE an UPPERCASE hex digit '0' -> 'F'. Enables embedding 8 bit Hex character code into the Tit title string.
                    You can use eg "\\x00" to embed a literal sequence of "\x00" into the title string, ie "\\" embeds a single backslash and so does not interpret as hex insertion code.
                       Use similar to avoid color escape code eg "\\a-" to embed literal "\a-".
                   Esc=False, does NOT process color Escape codes nor Hex insertion Escape code.
                       NOTE, the only character in range 0->31 that can be used in Tit title string is BEL [chr(7)] (where "\a" is converted to BEL color switch code), all other codes
                   in range 0->31 (eg chr(9) TAB) are converted to SPACE character. Also, CarriageReturn(13) and Newline(10) will terminate the title string early, eg you cannot
                   use Newline(10) to print on the input clip [neither as "\n" nor Chr(10)].
                   Likewise, characters $E0 -> $FF will be converted to SPACE character (they also do not exist in font).

    eg,

    # Chr(137) [$C9]is Copyright symbol (c).
    ColChr = "!"    # Hilite Code (takes effect from FrameNumber as ShowFrameNumber=True)
    Return ColorBars.Titlebar("TitleBar \a-\xC9 StainlessS \a*2019",True,ColChr,Esc=true) # FrmNo=Hilite, copyright in Default, Year in same as FrmNo

    COLOR TABLE:-
    # Ordinal  Color           ColChr or eg("\a0" for embedded DARKGRAY)
    00)        DARKGRAY        "0"
    01)        DODGERBLUE      "1"
    02)        ORANGERED       "2"
    03)        ORCHID          "3"
    04)        LIME            "4"
    05)        AQUAMARINE      "5"
    06)        YELLOW          "6"
    07)        WHITE           "7"
    08)        SILVER          "8"
    09)        CORNFLOWERBLUE  "9"
    10)        ORANGE          "A"
    11)        PLUM            "B"
    12)        CHARTREUSE      "C"
    13)        POWDERBLUE      "D"
    14)        GOLD            "E"
    15)        GAINSBORO       "F"
    #
    #          Grey           ColChr
    16)        $00            "G"
    17)        $11            "H"
    18)        $22            "I"
    19)        $33            "J"
    20)        $44            "K"
    21)        $55            "L"
    22)        $66            "M"
    23)        $77            "N"
    24)        $88            "O"
    25)        $99            "P"
    26)        $AA            "Q"
    27)        $BB            "R"
    28)        $CC            "S"
    29)        $DD            "T"
    30)        $EE            "U"
    31)        $FF            "V"
    # Specials
    DEFAULT                   "-"
    HILITE                    "!"
    ON_ENTRY                  "*"
###################################

TitleBarTest.avs
############
    ColorBars(width=1024)
    # Chr(137) [$89]is Copyright symbol (c).
    SHOWFRAMENO = true
    COLCHR      = "!"    # Hilite Code (takes effect from FrameNumber if ShowFrameNumber=True, Else takes effect on Tit title string)
    ESC         = True
    Titlebar("Title\aDBar \a-\x89 \a2S\a3t\a4a\a5i\a6n\a8l\a9e\aAs\aBs\aCS \a*2019",ShowFrameNo=SHOWFRAMENO,ColChr=COLCHR,Esc=ESC)
############



See here:- https://forum.doom9.org/showthread.php?t=176062
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 4th February 2019 at 02:27.
StainlessS is offline   Reply With Quote
Old 12th March 2019, 23:26   #220  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Shuffle, plugin v1.03, (req VS 2008 runtimes). https://forum.doom9.org/showthread.php?t=176193

Code:
Shuffle, by StainlessS @ Doom9.

Shuffle spacial columns or rows (1D), or blocks(2D) of frames, or temporal shuffle (frame order), all shuffles Inversable, ie undoable.
Potential usage in clip obfuscation using 'secret keys', or slideshow random ordering of frames.

Plugin for all Avs/+ valid colorspace.
Dll's for Avs v2.58, v2.60/+ x86 and x64.

    Shuffle1D_X(clip c, Int "Seed"=0, Int "blkW"=8, Bool "Once"=False, Bool "Inverse"=False )                                            # Horizontal 1D Shuffle
    Shuffle1D_Y(clip c, Int "Seed"=0, Int "blkH"=8, Bool "Interlaced"=False, Bool "Once"=False, Bool "Inverse"=False )                   # Vertical   1D Shuffle
    Shuffle2D  (clip c, Int "Seed"=0, Int "blkW"=8, Int "blkH"=blkW, Bool "Interlaced"=False, Bool "Once"=False, Bool "Inverse"=False )  # 2D Shuffle
    ShuffleT   (clip c, Int "Seed"=0, Bool "Inverse"=False )                                                                             # Shuffle Temporal, ie frame order.

    c,          Clip to Shuffle
    Seed,       -1=Random seed (Non inverse-able), 0 (default) same shuffle every time, Else any other int = UserSeed or 'SECRET_KEY'.
    BlkW,       Default 8, width of blocks or columns to shuffle.
                (Must be compatible with X Crop args, eg 2 or multiple thereof for YV12, also must divide exactly into Width of clip, use crop or Addborders where necessary).
    BlkH,       Shuffle1D_Y Default=8. Shuffle2D Default=BlkW, NOTE, Changed from original default 8.
                Height of blocks or rows to shuffle.
                (Must be compatible with Y Crop args, eg 2 or multiple thereof for YV12, also must divide exactly into Height of clip, use crop or Addborders where necessary).
    Interlaced, If True, then doubles minimum requirement of BlkH (Shuffle1D_Y and Shuffle2D ONLY).
                    eg YV12, where Interlaced=False blkH would require multiple of 2, and where Interlaced, Would would require multiple of 4, so as not to destroy interlacing.
    Once,       Default False. If true, then uses the same shuffle pattern for every frame, else shuffled differently for every frame.
                    Perhaps better compression if not using ShuffleT.
    Inverse,    Reverses previously done shuffling, Must Use Same Key as was used for the Shuffling stage (and maybe ideally all in reverse shuffle order).

Where ONLY 2 x 1D shuffles (ie both X and Y shuffling), then the order for de-shuffling does not matter, can use Inverse X and then Inverse Y or vice versa.
Shuffle2D is much better than 2x1D shuffles ie Shuffle1D_X + Shuffle1D_Y (or vice versa).
Shuffle2D together with either of the 1D shuffles is a bit pointless.
If using ShuffleT (frame order shuffle) suggest before or after ALL other shuffles, and in reverse order when Inverse = true.
If Inverse, then must uses same Seed, BlkW, BlkH, Interlaced and Once args to recover obfuscated source.
Seed, can be different for all Shuffle instances, if any of them use random seed (-1), you will not be able to inverse the result.
For ShuffleT(), source clip should be frame accurate and ideally not from eg DIVX/XDIV (they can often have a key frame only every 8 seconds or so, so would be VERY slow).

(Q) What use is seed=0      ? (A) Exact same sequence every time.
(Q) What use is Random seed ? (A) maybe for ShuffleT() of pics for slideshow.

The AVS Folder has a number of Demos (7 at time of writing) that will run with Colorbars or An Avi.
Some images from included scripts.

Shuffle_2x1D.avs


Shuffle_2D.avs


Shuffle_Compared.avs


Shuffle_T.avs


Shuffle_3D.avs




.



.



see here:- https://forum.doom9.org/showthread.php?t=176193
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 16th August 2020 at 07:24.
StainlessS is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.