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

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th April 2013, 02:36   #161  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
New version FrameSelect v1.02.

Added filter:
FrameReplace(clip,clip, int F1, ... , int Fn, string 'SCmd',string 'Cmd', bool 'Show', bool 'Ver')

Args identical to FrameSelect, with exception of the 2nd clip arg which is a clip of frames to replace into the 1st clip arg.
The other args must be identical to the script that originally extracted the frames.

FrameSelect here:
http://forum.doom9.org/showthread.php?t=164497

FrameReplace() prompted by this thread:
http://forum.doom9.org/showthread.ph...75#post1625975

EDIT:
FrameReplace replaces frames extracted with FrameSelect(), back into the original clip.
Use the same command args that were used to extract the clip.

v1.03,
Added "Reject" arg to FrameSelect, toggles operation to select NON-SELECTED frames instead of selected ones.


EDIT: FrameSel (FrameSelect REVAMP, ie update/renamed plug) : See 3 posts below ie post #164.
__________________
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 2015 at 15:32.
StainlessS is offline   Reply With Quote
Old 16th May 2013, 16:18   #162  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
SecurityCamExtractMotion.AVS, v1.0, Included as part of new version RT_Stats new v1.17.

Requires RT_Stats v1.17, FrameSelect v1.03, GScript, Grunt, Maybe DeGrainMedian if required.

Extracts movement from security camera footage:- here
http://forum.doom9.org/showthread.ph...75#post1628675

Works really well.

One clip about 11:00 PM, cut down to about 10% of frames, where about 25 vehicles, 3 cyclists, 2 pedestrians and one fox caused
motion detection. Original clip about 18 mins. Dark, rain shimmering under street lamps.

2nd clip, about 02:00 AM cut down to about 3.5% of frames, where about 9 vehicles caused motion detection.
Original clip about 18 mins. Dark, little activity.

EDIT: Also FrameSelect update see previous post EDIT.
__________________
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 May 2013 at 16:30.
StainlessS is offline   Reply With Quote
Old 11th June 2013, 11:20   #163  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
New plugin (well a week or so old),

FrameRepeat() v1.00, Plugin for Avisynth v2.5 & v2.6 by StainlessS.
Code:
FrameRepeat() is a simple plugin to select frames to repeat.

Video:- Planar, YUY2, RGB32, RGB24.
Audio:- Returns NO AUDIO.

FrameRepeat(Clip,int 'default',string 'Cmd', bool 'Show', bool 'Ver')

        default, int, default=0. The default repeat count for frames not mentioned in command file.
                Default =0, is, frames not mentioned in Cmd command file are excluded (repeated 0 times, ie not output at all).

        Cmd,    string, Default= "", Not set.
                Command file, frame numbers supplied in a file. Use eg "Repeat.txt" for command file in your script directory.

#------------- # below contents of a text file eg "Repeat.txt".
1 1    # This is a comment. Output frame 1 once.
2      # Single frame number without a repeat count, outputs frame only once, equivalent to 2 1.
3,2    # Can also use ',' COMMA rather than SPACE as a number separator. Outputs frame 3 twice.
5,3    # Output frame 5, 3 times.
#-------------

Given a 6 frame clip (frames 0 -> 5)

FrameRepeat(clip,default=0,cmd="Repeat.txt")  # would produce this sequence "1,2,3,3,5,5,5".

FrameRepeat(clip,default=1,cmd="Repeat.txt")  # would produce this sequence "0,1,2,3,3,4,5,5,5".

FrameRepeat(clip,default=2,cmd="Repeat.txt")  # would produce this sequence "0,0,1,2,3,3,4,4,5,5,5".

FrameRepeat(clip,default=3)  # would produce this sequence "0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5".
                             # Note, above without a command file.
here: http://forum.doom9.org/showthread.ph...38#post1632538
__________________
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; 11th June 2013 at 11:24.
StainlessS is offline   Reply With Quote
Old 11th June 2013, 11:39   #164  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
New Plugin, FrameSel/FrameRep v2.0 (FrameSelect REVAMP)

Code:
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).

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

FrameRep(), replace back into clip (from whence they came).
here: http://forum.doom9.org/showthread.php?t=167971
__________________
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 11th June 2013, 11:46   #165  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
New Plugin, ClipBlend/Clipblend16 v0.0

Code:
ClipBlend(clip,"delay"=0)    	# 8 bit Planar, YUY2, RGB
ClipBlend16(clip,"delay"=0)    	# 16 bit, Stack16 Planar, YUY2, RGB (see Dither Tools)

Added Delay arg to plugin.

Delay, default = 0, == ALL frames played so far blended.

1  = blend with previous frame.
10 = blend with 10 previous frames, etc.

Accumulator resets at frame 0 and if you jump about.
See here: http://forum.doom9.org/showthread.ph...42#post1632542
__________________
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 24th July 2013, 12:59   #166  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RgbAmplifier v1.01 - Forensic Tool, new plugin

RGB24 and RGB32
========================================
An Avisynth plugin to amplify color shifts

Given a clip, this filter examines every pixel of every frame and independently multiplies the difference of its specific
R, G and B values from the average R, G and B values of that same pixel location spanning a defined radius of adjacent frames.
If the new values are above or below the allowed RGB values, they are capped at those limits.
The revised RGB values replace the original values, and the amplified clip is returned.
If the Multiplier is set to a value of zero, the plugin acts as a temporal frame averager.

This plugin will:
Convert seemingly imperceptible color changes into obvious color changes
Highlight seemingly imperceptible movements of high contrast pixels
Sharpen the details of moving objects
Cause distortion or ghosting/transparency effect to moving objects (an unavoidable side effect)

This plugin requires RGB24 or RGB32 color space, and is intended for forensic analysis of videos created from fixed position cameras.
Usage on non-stationary cameras may produce unpredictable or content destructive results. The faster the object and/or the greater
the radius, the greater the risk of negatively impacting the visual accuracy of the moving object.

here: http://forum.doom9.org/showthread.php?t=168293
__________________
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 9th August 2013, 08:09   #167  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
MDec2 New Filter v1.0

MDec2, MultiDecimate like decimating filter.

Planar, YUY2, RGB

MDEC2(clip c,float "rate"=24.0,bool "show"=false,bool "create"=false,string "dir"="C:\",bool "chroma"=true,bool "ver"=false)

MDec2 is a 2 pass decimating filter, acting much like the Multidecimate filter by Donald Graft.
Requires MultiDecimate.Exe & ProcessMD.Exe from MultiDecimate package.

See Here:
http://forum.doom9.org/showthread.ph...22#post1639822
__________________
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 11th September 2013, 00:06   #168  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RoboCrop() v1.00, new plugin.
http://forum.doom9.org/showthread.ph...62#post1632662

Code:
Plugin's for both Avisynth v2.5 and v2.6.

RoboCrop is an automatic cropping solution to crop black borders from video clips, loosely based on (but using no code from)
Autocrop by Glenn Bussell.

For the most part, you can just call it with RoboCrop(clip) and not bother with any other arguements, it is intended to be pretty
much autonomous in its decisions. You might however want to alter eg WMod and HMod if your encoder has special requirements, and
perhaps Laced if your source is likely to be fully progressive.

Borders are detected by sampling at Samples frames, at scanlines (h/v) using AverageLuma (RGB is converted to Luma Y at either TV or
PC levels, See Matrix). This sampling is done on all 4 sides of the frame.
If a scanline Average luma is below or equal to Thresh, then is considered possible black border, above considered possible image,
if Baffle [default=4] adjacent scanlines above Thresh, then it IS image.
__________________
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 September 2013, 13:30   #169  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Planetorium

A new plugin Planetarium suitable for use by Planetariums for warping input fish eye image for use with spherical mirror to project on to dome.
Discussion thread
__________________
mohan
my plugins are now hosted here

Last edited by vcmohan; 14th January 2014 at 03:55.
vcmohan is offline   Reply With Quote
Old 9th December 2013, 00:10   #170  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 600
WeaveMan: remove arbitrary pulldown patterns manually

For perfectionists to undo non-standard 24->25 fps, 25->29.97 fps, etc. telecine conversions, along with other weird telecine anomalies created by broadcasters speeding up film-sourced content.

A sample case is here. If you have a sample you would like to try the filter with, post it in the thread above and I will try to explain how to use it.

Last edited by ChiDragon; 9th December 2013 at 00:14.
ChiDragon is offline   Reply With Quote
Old 16th August 2014, 23:39   #171  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
Deshaker3D

Deshaker3D

3D image stabilisation - effectively an Avisynth substitute for pass 2 of guth's VirtualDub filter Deshaker.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 20th December 2014, 21:08   #172  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
amp - temporal smoother/enhancer

Inspired by RgbAmplifier, which I couldn't get to work, I've written a plugin called amp.

It performs temporal smoothing, then (optionally) enhances the difference between the windowed average and the current frame. In theory, this should let you do things like make pulses visible in videos of human faces or wrists, but I suspect you need a very low noise video to pick that up.

Also worth noting is that it will easily enhance codec artefacts, so for enhancing very small changes, it probably works best with lossless or intra-frame codecs like MJPEG or DV.

It works in YV12, YUY2, RGB24 and RGB32 colourspaces, and because of this its parameters are a bit changeable:

Code:
amp(clip c, int window, double y, double u, double v, double a)
window is the number of frames either side of the current one used for the temporal smoothing, i.e. a value of 5 will smooth over 5*2+1=11 frames.

For YV12/YUY2 colour spaces, the parameters y u v specify the level of enhancement for each channel. a is ignored.

For RGB24/RGB32 colour spaces, the parameters y u v [a] specify the level of enhancement for the channels r g b [a].

A value of 0 performs no enhancement (returns the unaltered channel of the source frame).
If you only specify y, the same value will be used for the other channels.
By not specifying any of these four parameters (or giving them the value of -1) the filter acts purely as a temporal smoother.

David
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 20th December 2014 at 21:21.
wonkey_monkey is offline   Reply With Quote
Old 17th June 2015, 20:26   #173  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RgbAdapt v0.3 new(ish) plugin. http://forum.doom9.org/showthread.php?t=170642

Code:
For Avisynth v2.58+

RGB24/RGB32.
Audio as original.

RGBAdapt(clip c, \
    \ Float "R_Bias"=0.0,Float "R_Gain"=1.0,Float "R_Cont"=1.0,Float "R_RPow"=1.0,Float "R_Spow"=1.0,Float "R_SPMid"=0.5,Bool "R_Pord"=false,
    \ Float "G_Bias"=0.0,Float "G_Gain"=1.0,Float "G_Cont"=1.0,Float "G_RPow"=1.0,Float "G_Spow"=1.0,Float "G_SPMid"=0.5,Bool "G_Pord"=false,
    \ Float "B_Bias"=0.0,Float "B_Gain"=1.0,Float "B_Cont"=1.0,Float "B_RPow"=1.0,Float "B_Spow"=1.0,Float "B_SPMid"=0.5,Bool "B_Pord"=false,
    \ Int "R_IMin"=0,Int "R_OMin"=0,Int "R_IMax"=255,Int "R_OMax"=255,
    \ Int "G_IMin"=0,Int "G_OMin"=0,Int "G_IMax"=255,Int "G_OMax"=255,
    \ Int "B_IMin"=0,Int "B_OMin"=0,Int "B_IMax"=255,Int "B_OMax"=255
    \ )

Bias    -512.0 -> 512.0.                Bias = Brightness. 
Gain    -8.0   -> 8.0                   Gain = Zero relative contrast.
Cont    -8.0   -> 8.0                   Cont = Centre relative Contrast.
RPow    0.1    -> 4.0                   RPow = Gamma, r shaped power curve.
SPow    0.1    -> 4.0                   SPow = S shaped power curve.
SPMid   0.01   -> 0.99                  SPMid = Controls Inflection point for S shaped power curve, 0.5 = mid point ie 0.5*255.0
Pord    True/False                      Pord=Rpow processed first (False) or SPow first (True). The power functions are non commutative.

    Assuming all settings apart from RPow, SPow and SPMid at defaults:-
     Pord Default (false) RPow1st, when modifying RPow or SPow, the SPow power curve inflection point will
    remain fixed at Y = SPMid * 255.0, Rpow will slide it left or right.
     Pord SPow1st, when modifying RPow or SPow, the SPow power curve inflection point will remain fixed
    at X = SPMid * 255.0, RPow will slide it up or down.

New args v0.3
IMin    0 -> 255 : IMin <= (IMax+1)
OMin    0 -> 255
IMax    0 -> 255 : (IMin-1) <= IMax
OMax    0 -> 255

 Any INPUT value less than IMin will be mapped to OMin (both default to 0), and values greater than IMax will be mapped to
OMax (both default to 255). With default settings the Min/Max options have no effect. 
These options allow for weird shaped LUT's to eg create masks. Example, Leaving all other settings at default and
for some channel set IMax to eg 127 and OMax to 64 would map all input above 127 to 64 while leaving everything else untouched.
If you additionally set eg IMin=128 and OMin=180, then 0-127 would map to 180 and 128->255 map to 64.
The IMin <= (IMax+1) requirement allows you to map the entire 0->255 range to any two output values.

  

RgbAdapt_Graffer.exe demos the plugin and all arguments. (Will require VB6 runtimes, most will already have these.)
And here a pic of the Graffer:-


The Ring on the Fish's cheek shows the pixel that is being tracked and the Before and After colors shown in status bar.
Monitor changes for single pixel as you modify the sliders.
The tick box on left show that SPow is locked so R + G + B settings are affected simultaneously.
__________________
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; 9th January 2019 at 05:27. Reason: Fishes -> Fish's
StainlessS is offline   Reply With Quote
Old 1st July 2015, 16:18   #174  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Update to Histograms in RGB & CMY: here.
fvisagie is offline   Reply With Quote
Old 3rd July 2015, 17:38   #175  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Histograms in RGB & CMY updated again here.
fvisagie is offline   Reply With Quote
Old 12th September 2015, 22:25   #176  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
rgba_rpn/y8_rpn

RPN pixel manipulator. Does just about anything*

*okay, not anything. But a lot.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 27th December 2015, 03:44   #177  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
VD_EdKey. New Utility for Avisynth, v1.00

Code:
VD_EdKey v1.00.

VD_EdKey, is a compiled AutoIt script utility, intended to assist in creating Avisynth frames command files.
Create command file in VirtualDub with VD_EdKey, and use command file in Avisynth script functions.

VD_EdKey is used together with VirtualDub and NotePad. You must run the app, with BOTH VirtualDub and the
NotePad Editor VISIBLE, you can scroll through a video clip, and press eg CTRL/INSERT to insert the current frame number 
into the NotePad Editor. You press the keys with VDub as the active window (not NotePad).
VD_EdKey requires VirtualDub, VirtualDubMod will not be recognised (It does not provide marked ranges in Status Bar).
After creating Command file in NotePad, Save as eg Command.txt and provide it as eg SelectRanges(Cmd="Command.txt") or
RejectRanges((Cmd="Command.txt") {Select/RejectRanges supplied with both Framesel and Prune Avisynth plugins).
    
*** Current frame is shown in VirtualDub in the middle of the status bar. ***
*** Ranges are marked in VirtualDub via HOME and END keys, shown at Left of status bar (when marked). ***

It is important to NOT do any VirtualDub clip editing, if you eg delete a frame in VirtualDub, then all frames after that frame will
be off by 1, and so all VD_EdKey edited ranges/frames inserted later into NotePad file will be also off by 1.
The VDub loaded clip can be either an AVI or AVS clip, it makes no difference.     

All VD_EdKey Keyboard commands:-
    # Inserted into NotePad Text file
    CTRL/INSERT         Insert current frame eg '42'.
    CTRL/SHIFT/INSERT   Insert current range eg '42,52'. (single frame range is converted to single frame)
      # Special use (where script frames file processor gives special meaning to -ve frame or range):
      CTRL/DELETE         Insert -ve current frame '-42'.
      CTRL/SHIFT/DELETE   Insert -ve current range '-42,52'. (single frame range is converted to single frame)    
    # Terminate:
    CTRL+SHIFT+ALT+PAUSE is TERMINATE Program (or close via System Tray icon). PAUSE is also known as BREAK, usually next to Scroll Lock.

NOTE: A range shown in VDub status bar as eg "Selecting Frames 100-102(2 frames)" represents frames 100 and 101, frame 102 is exclusive and
does not count. By default, VD_EdKey uses Inclusive END frame ranges (same as Avisynth where end frame DOES count).
You can change the default behaviour to behave the same as VDub by Running VD_EdKey.Exe at least once and changing the auto created
VD_EdKey.ini file contents from "RangeEndIsExclusive=0" to "RangeEndIsExclusive=1". When using VDub "RangeEndIsExclusive=1" mode,
we subtract 1 from the End Frame to convert to Avisynth End Frame Inclusive specification when writing range to NotePad command.
When sending a command using VDub exclusive mode with a status bar range of "100-100(frames=0)", it will beep and show a "No Frames"
type error message for a few seconds, in Avisynth Inclusive mode it will send a 1 frame range command to the NotePad window.   

It is easy to see what is happening as the NotePad window will be visible and after each insertion into NotePad, an ENTER key
will also be sent to move the cursor down one line, each command is on its own line. If you make a mistake, it is easy to
just switch to NotePad window and delete the erroneous line.
 
That is it, thats all it does. Is easier than switching windows, insert/delete frame number, and then back to original window again.

AutoiIt compiled executable with source provided, just click Menu Tools/build to create executable (In Scite4AutoIt3 editor).
Requires AutoIt3 and  Scite4AutoIt3 editor to re-build executable. 

ssS
Here:- http://forum.doom9.org/showthread.php?t=173010
__________________
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 February 2016 at 03:01. Reason: Update
StainlessS is offline   Reply With Quote
Old 6th January 2016, 06:25   #178  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
TWriteAVI v2.02, Plugin Update of existing plugin (never appeared in new plugins thread before).

TWriteAVI v2.0, can write lossless whatever can be played to AVI (or WAV), and using the ForceProcessAVI/WAV functions, can write the
files [or logs] without playing them.

Two Pass:
Code:
    WhateverSource(...)
    A_Two_Pass_Function(Pass=1) # Create some kind of deshaker log or whatever.
    ForceProcessAVI()           # Force Pass 1, creating log (A function From TWriteAVI plug)
    A_Two_Pass_Function(Pass=2) # Use created log
    return Last
The ForceProcessAVI 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.
ForceProcessAVI/WAV are runtime functions not filters and so only return on completion.

Simultaneous play and save AVI
Code:
    WhateverSource(...)
    FN="Output.AVI"
    FOURCC="ULY0" # Ut_Video
    TWriteAVI(FN,Overwrite=true,fourcc=FOURCC).
    return Last
Do some kind of processing and save AVI, Then play Lossless file.
Code:
    WhateverSource(...)
    FN="Output.AVI"
    FOURCC="ULY0" # Ut_Video
    Sharpen(0.3)                                 # Whatever
    TWriteAVI(FN,Overwrite=true,fourcc=FOURCC).  # Write Sharp AVI whilst clip is played
    ForceProcessAVI()                            # Force Write above TWriteAVI file without playing clip.
    AVISource(FN)                                # Load Saved AVI
    return Last                                  # Play Sharpened AVI lossless clip
Code:
Function TWriteAvi(clip c,String filename,bool "overwrite"=false,bool "showall"=false,string "fourcc"="",int "dwChannelMask"=-1)
ForceProcessAVI(clip c)
 Force Process clip c, ie read from first to last frame, for TWriteAVI writes the AVI file (Video + Audio) without having to play clip.
Function TWriteWAV(clip c,String filename,bool "overwrite"=false,int "dwChannelMask"=-1)
ForceProcessWAV(clip c)
 Force Process clip c audio only, ie read from first to last audio sample, for TWriteWAV writes the WAV file (Audio) without having to play clip.
Here:- http://forum.doom9.org/showthread.php?t=172837
__________________
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; 20th January 2016 at 02:10.
StainlessS is offline   Reply With Quote
Old 3rd February 2016, 00:13   #179  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
SawBones/FrameSurgeon v1.00, a VirtualDub/Avisynth script, utility combo to edit bad frames.
Create Command file in VirtualDub with Sawbones, and use Command file in Avisynth script function FrameSurgeon().

Code:
SawBones v1.00

SawBones, is a compiled AutoIt script utility, intended to assist in creating Avisynth command file for FrameSurgeon.avs script.

SawBones is used together with VirtualDub and NotePad. You must run the app, with BOTH VirtualDub and the
NotePad Editor VISIBLE, you can scroll through a video clip, and press eg CTRL/DELETE to insert a FrameSurgeon DELETE (DEL n) command 
for the current frame into the NotePad Editor. You press the keys with VDub as the active window (not NotePad).
SawBones requires VirtualDub, VirtualDubMod will not be recognised (It does not provide marked ranges in Status Bar).
After creating Command file in NotePad, Save as eg Command.txt and provide it as eg FrameSurgeon(Cmd="Command.txt").
    
*** Current frame is shown in VirtualDub in the middle of the status bar. ***
*** Ranges are marked in VirtualDub via HOME and END keys, shown at Left of status bar (when marked). ***
*** FXd clips (where d is Digit 1-9) are user provided to FrameSurgeon.avs function and default to source clip if not user supplied. ***
*** Interpolation commands in FrameSurgeon are for YV12 and YUY2 only, others any colorspace. ***

It is important to NOT do any VirtualDub clip editing, if you eg delete a frame in VirtualDub, then all frames after that frame will
be off by 1, and so all SawBones edited ranges/frames inserted later into NotePad file will be also off by 1.
The VDub loaded clip can be either an AVI or AVS clip, it makes no difference, you could eg have a stacked multi-window frame
open in VDub so as to choose from your FXd clips.     

All SawBones Keyboard commands that are inserted into NotePad Text file:-

    CTRL/F1             CopyFromPrevious frame to current frame (ie replace current frame n with frame n - 1. (CP n)
    CTRL/F2             CopyFromNext frame to current frame (ie replace current frame n with frame n + 1. (CN n)
    
    CTRL/1              Replace current frame with same frame from FX1 clip. (FX1 n)
    CTRL/2              Replace current frame with same frame from FX2 clip. (FX2 n)
    CTRL/3              Replace current frame with same frame from FX3 clip. (FX3 n)
    CTRL/4              Replace current frame with same frame from FX4 clip. (FX4 n)
    CTRL/5              Replace current frame with same frame from FX5 clip. (FX5 n)
    CTRL/6              Replace current frame with same frame from FX6 clip. (FX6 n)
    CTRL/7              Replace current frame with same frame from FX7 clip. (FX7 n)
    CTRL/8              Replace current frame with same frame from FX8 clip. (FX8 n)
    CTRL/9              Replace current frame with same frame from FX9 clip. (FX9 n)
    
    CTRL/SHIFT/1        Replace range with same range from FX1 clip. (FX1 s,e)
    CTRL/SHIFT/2        Replace range with same range from FX2 clip. (FX2 s,e)
    CTRL/SHIFT/3        Replace range with same range from FX3 clip. (FX3 s,e)
    CTRL/SHIFT/4        Replace range with same range from FX4 clip. (FX4 s,e)
    CTRL/SHIFT/5        Replace range with same range from FX5 clip. (FX5 s,e)
    CTRL/SHIFT/6        Replace range with same range from FX6 clip. (FX6 s,e)
    CTRL/SHIFT/7        Replace range with same range from FX7 clip. (FX7 s,e)
    CTRL/SHIFT/8        Replace range with same range from FX8 clip. (FX8 s,e)
    CTRL/SHIFT/9        Replace range with same range from FX9 clip. (FX9 s,e)
    
    CTRL/SHIFT/ALT/1    Interpolate current frame n using n-1 and n+1 as source frames. (I1 n)
    CTRL/SHIFT/ALT/2    Interpolate 2 frames starting at current frame n, using n-1 and n+2 as source frames. (I2 n)
    CTRL/SHIFT/ALT/3    Interpolate 3 frames starting at current frame n, using n-1 and n+3 as source frames. (I3 n)
    CTRL/SHIFT/ALT/4    Interpolate 4 frames starting at current frame n, using n-1 and n+4 as source frames. (I4 n)
    CTRL/SHIFT/ALT/5    Interpolate 5 frames starting at current frame n, using n-1 and n+5 as source frames. (I5 n)
    CTRL/SHIFT/ALT/6    Interpolate 6 frames starting at current frame n, using n-1 and n+6 as source frames. (I6 n)
    CTRL/SHIFT/ALT/7    Interpolate 7 frames starting at current frame n, using n-1 and n+7 as source frames. (I7 n)
    CTRL/SHIFT/ALT/8    Interpolate 8 frames starting at current frame n, using n-1 and n+8 as source frames. (I8 n)
    CTRL/SHIFT/ALT/9    Interpolate 9 frames starting at current frame n, using n-1 and n+9 as source frames. (I9 n)
    
    CTRL/DELETE         Delete current frame. (DEL n)
    CTRL/SHIFT/DELETE   Delete range (DEL s,e)


NOTE, By default, SawBones uses Inclusive END frame ranges (same as Avisynth) whereas VDub uses Exclusive END frame ranges,
ie range 100,102 in Avisynth is 3 frames (100 to 102), in VDub it is only 2 frames (100 to 101), you can change default behaviour
to behave the same as VDub by Running SawBones.Exe at least once and changing the auto created SawBones.ini file contents
to "RangeEndIsExclusive=1". If using default setting "RangeEndIsExclusive=0", then if a marked Range is shown in status bar as
"100-102" then range used will be 3 frames, if "RangeEndIsExclusive=1" then range used will be 2 frames.
It is easy to see what is happening as the NotePad window will be visible and after each insertion into NotePad, an ENTER key
will also be sent to move the cursor down one line, each command is on its own line. If you make a mistake, it is easy to
just switch to NotePad window and delete the erroneous line.

Where same frames are flagged for replacment mulitple times, later one will take precidence.
All frame/range deletes will be done AFTER replacements, multiple deletes on same frame will only result on single frame deletion.
Already Interpolated frames/ranges CANNOT be replaced and will produce an error (In avs script), but they can be deleted. 

FrameSurgeon.avs requires MvTools, GScript, RT_Stats, FrameSel, ClipClop and Prune Plugins.

AutoiIt compiled executable with source provided, just click Menu Tools/build to create executable (In Scite4AutoIt3 editor).
Requires AutoIt3 and  Scite4AutoIt3 editor to re-build executable. 

ssS
Code:
Function FrameSurgeon(clip c, String "Scmd",String "Cmd",bool "Show",Int "ShowMode",int "dv",
        \ clip "FX1",clip "FX2",clip "FX3",clip "FX4",clip "FX5",clip "FX6",clip "FX7",clip "FX8",clip "FX9",
        \ int "pel",int "sharp",int "rfilter",Float "ml") {

    FrameSurgeon() by StainlessS:-
       Requires MvTools[(c) Manao], GScript[(c) Gavino], RT_Stats, FrameSel, ClipClop and Prune Plugins [(c) StainlessS].
       Any colorspace, Interpolation commands in FrameSurgeon for YV12 and YUY2 only.

    Replace/Delete damaged frames using commands in a either command string or file (one command per line in both file and string).
    If both string (SCmd) and file (Cmd) commands supplied, then File Processed first and then String later (relevant as later
    replacements take precedence where a frame replaced more than once). Any deletes take place AFTER ALL replacements have been done.
    Interpolation Commands are available for YV12 and YUY2 only due to MVTools usage (fails if 'Id' commands used in other colrspaces).
    
    Args-:
        c,                         Source clip.
        SCmd,     Default "",      Commands supplied as string.
        Cmd,      Default "",      Commands supplied as FileName. (Either SCmd or Cmd MUST be supplied).        
        Show:     Default False,   Show Info on Frame.
        ShowMode: Default 0,       When Show==true, then 0=Show ClipClop metrics(post replacement), else if 1 Show Prune Metrics(post Delete).
        Dv,       Default 0,       ClipClop and Prune DebugView level (0 - 4, Need DebugView utility)
        FX1-FX9,  Default c,       Defaults to source clip, and if Show==True then Subtitled as eg "FX1" in frame center.
                                   User Replacement clips. eg could use FX1 clip as Light Denoise, FX2 as Medium Denoise or whatever.
        Interpolation args:-       MvTools args. Used for 'Id' commands (where d = digit 1 to 9).
          pel     Default 2,       Default as for MSuper(), ie 2, range=1 or 2 or 4
          sharp   Default 2,       Default as for MSuper(), ie 2, range=0 -> 2
          rfilter Default 2,       Default as for MSuper(), ie 2, range=0 -> 4
          ml      Default 100.0,   Default as for MFlowInter(), ie 100.0, range=greater than 0.0.
        
    Supported commands (where n=frame number, s= range start frame, e=range end frame, d is digit '1' to '9'
                       NOTE, e range End Frame behaves as in trim eg -20 means 20 frames starting at frame s, e=0 means to last frame):-  
        "CP  n"        CopyFromPrevious ie replace frame n with frame n - 1.
        "CN  n"        CopyFromNext ie replace frame n with frame n + 1.        
        "I1  n"        Interpolate 1 frame n (using frames n-1 and n+1 as Interpolation source frames, (Id commands YV12, YUY2 only).
        "I2  n"        Interpolate 2 frames starting at frame n, (using frames n-1 and n+2).
        "I3  n"        Interpolate 3 frames starting at frame n, (using frames n-1 and n+3).
        "I4  n"        Interpolate 4 frames starting at frame n, (using frames n-1 and n+4).
        "I5  n"        Interpolate 5 frames starting at frame n, (using frames n-1 and n+5).
        "I6  n"        Interpolate 6 frames starting at frame n, (using frames n-1 and n+6).
        "I7  n"        Interpolate 7 frames starting at frame n, (using frames n-1 and n+7).
        "I8  n"        Interpolate 8 frames starting at frame n, (using frames n-1 and n+8).
        "I9  n"        Interpolate 9 frames starting at frame n, (using frames n-1 and n+9).
        "FXd n"        Replace frame n with same frame from FXd clip, eg "FX3 100" replace frame 100 with same frame from FX3 clip.
        "FXd s,e"      Replace range s to e with same range from FXd clip.
        #              
        "-n"           Delete frame n
        "DEL n"        Delete frame n
        "-s,e"         Delete frames s to e
        "DEL s,e"      Delete frames s to e
Here:- http://forum.doom9.org/showthread.ph...59#post1755859
__________________
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; 3rd February 2016 at 20:27.
StainlessS is offline   Reply With Quote
Old 15th February 2016, 21:13   #180  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
xNLMeans

xNLMeans doom9 forum thread
CPU-based 'Non Local Means' denoiser implementation with some extensions for improved usability, please see manual for details

Last edited by martin53; 16th February 2016 at 17:45. Reason: added link
martin53 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 16:33.


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