<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://avisynth.nl/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ajk</id>
		<title>Avisynth wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ajk"/>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Special:Contributions/Ajk"/>
		<updated>2026-04-21T18:47:36Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.24</generator>

	<entry>
		<id>http://avisynth.nl/index.php/Median</id>
		<title>Median</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Median"/>
				<updated>2017-02-18T12:16:46Z</updated>
		
		<summary type="html">&lt;p&gt;Ajk: Updated URLs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Plugins|Adjustment_filters|Averaging}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
| {{Author/ajk}}&lt;br /&gt;
| v0.6&lt;br /&gt;
|[http://ajk.pp.fi/avisynth/Median-0.6.zip Median-0.6.zip]&lt;br /&gt;
| Averaging&lt;br /&gt;
| ''Public domain. Credit would be nice, but do with this what you will.''&lt;br /&gt;
|6=[http://forum.doom9.org/showthread.php?t=170216 Doom9 Thread], [http://forum.videohelp.com/threads/362361-Median%28%29-plugin-for-AviSynth VideoHelp Thread]}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&amp;lt;tt&amp;gt;Median.dll&amp;lt;/tt&amp;gt; is a filter plugin for AviSynth which generates a pixel-by-pixel median of several clips. This is particularly useful for filtering out noise and glitches from multiple VHS/SVHS/8mm/Hi8 tape captures, but can be used for other purposes also.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/  greater]&lt;br /&gt;
* Supported color formats: [[YUY2]], [[YV12]], [[RGB32]], [[RGB24]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
&lt;br /&gt;
===Median===&lt;br /&gt;
Median() is the namesake function for this filter package. It takes a number of clips and outputs a frame which is the median of the input. Because for noise filtering applications having all the input clips exactly in sync is important, it also includes functionality to line up slight mismatches that can be present due to framedrops during capture.&lt;br /&gt;
:{{Template:FuncDef|Median (clip, clip, clip, ..., bool &amp;quot;chroma&amp;quot;, int &amp;quot;sync&amp;quot;, int &amp;quot;samples&amp;quot;, bool &amp;quot;debug&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clips between 3 and 25 are accepted. Odd number of clips is required.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|bool|true}}&lt;br /&gt;
:::Chroma is processed by default, but this can be turned off in which case the chroma from the first clip is used. In the case of RGB input, all colour planes are always processed. With RGB32 the chroma parameter can be used to turn off alpha channel processing.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|sync|int|0}}&lt;br /&gt;
:::If the clips are not exactly in sync, you can use this parameter to automatically line them up. The plugin will search up to this number of preceding and following frames to find the best match.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|samples|int|4096}}&lt;br /&gt;
:::Number of pixels to compare when determining similarity of frames for synchronization. The default seems to be fine most of the time but this parameter allows you to tweak the process.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debug|bool|false}}&lt;br /&gt;
:::Turns on debug output.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===MedianBlend===&lt;br /&gt;
There is also another, more flexible filter included, MedianBlend(). This function can be adjusted to for example return a clip derived from the minimum or maximum pixel values, or to discard some low (default: 1) and high (default: 1) values and blend the others together. With the paramteters set to not discard anything, the result is in fact the average of the clips. The other parameters work the same way as for Median().&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:{{Template:FuncDef|Median (clip, clip, clip, ..., int &amp;quot;low&amp;quot;, int &amp;quot;high&amp;quot;, bool &amp;quot;chroma&amp;quot;, int &amp;quot;sync&amp;quot;, int &amp;quot;samples&amp;quot;, bool &amp;quot;debug&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clips between 3 and 25 are accepted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|low|int|1}}&lt;br /&gt;
:::Number of low (dark) samples to discard.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|high|int|1}}&lt;br /&gt;
:::Number of high (light) samples to discard.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|bool|true}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|sync|int|0}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|samples|int|4096}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debug|bool|false}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===TemporalMedian===&lt;br /&gt;
You can also use the filter temporally on a single source clip. You can use a radius of up to 12 and the filter will take that many preceding and following frames into account when calculating the median. The other parameters work the same way as for Median().&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:{{Template:FuncDef|Median (clip, int &amp;quot;radius&amp;quot;, bool &amp;quot;chroma&amp;quot;, bool &amp;quot;debug&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clip.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|radius|int|1}}&lt;br /&gt;
:::Number of preceding and following frame to consider when calculating the median.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|bool|true}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debug|bool|false}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Examples == &lt;br /&gt;
Median of three clips, chroma is not processed:&lt;br /&gt;
 clip1 = AVISource(&amp;quot;capture1.avi&amp;quot;)&lt;br /&gt;
 clip2 = AVISource(&amp;quot;capture2.avi&amp;quot;)&lt;br /&gt;
 clip3 = AVISource(&amp;quot;capture3.avi&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
 Median(clip1,clip2,clip3, chroma=false)&lt;br /&gt;
Median of three clips, match frames up to 10 frames forward and back, print debug data on the image:&lt;br /&gt;
 Median(clip1,clip2,clip3, sync=10, debug=true)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Discard no values, output is an average function&lt;br /&gt;
  MedianBlend(clip1,clip2,clip3, low=0, high=0)&lt;br /&gt;
Discard highest values, output is a minimum function&lt;br /&gt;
 MedianBlend(clip1,clip2,clip3, low=0, high=2)&lt;br /&gt;
Discard lowest values, output is a maximum function&lt;br /&gt;
 MedianBlend(clip1,clip2,clip3, low=2, high=0)&lt;br /&gt;
Discard highest and lowest value and average the two remaining ones&lt;br /&gt;
 MedianBlend(clip1,clip2,clip3,clip4, low=1, high=1)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Median of five frames: current, two preceding, and two following:&lt;br /&gt;
 TemporalMedian(clip, radius=2)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version      Date            Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 v0.6         16/01/2016      - Added automatic clip synchronisation.&lt;br /&gt;
 v0.5         15/03/2014      - Fixed bug with chroma=false. Added TemporalMedian() functionality.&lt;br /&gt;
 v0.4         14/02/2014      - Added MedianBlend() functionality.&lt;br /&gt;
 v0.3         13/02/2014      - Fixed output frame buffer issue.&lt;br /&gt;
 v0.2         13/02/2014      - Added support for other colour spaces (planar and RBG24/32).&lt;br /&gt;
 v0.1         12/02/2014      - Initial release. YUY2 support only.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Archived Downloads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;; width=&amp;quot;600px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!!width=&amp;quot;100px&amp;quot;| Version&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Download&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Mirror&lt;br /&gt;
|-&lt;br /&gt;
!v0.6&lt;br /&gt;
|[http://http://ajk.kapsi.fi/projects/avisynth/median-plugin/Median-0.6.zip Median-0.6.zip]&lt;br /&gt;
|[http://web.archive.org/web/20170218121220/http://ajk.kapsi.fi/projects/avisynth/median-plugin/Median-0.6.zip Median-0.6.zip]&lt;br /&gt;
|}&lt;br /&gt;
For older versions take a look at [http://ajk.kapsi.fi/projects/avisynth/median-plugin ajk's repository] ([http://web.archive.org/web/20170218121220/http://ajk.kapsi.fi/projects/avisynth/median-plugin/ archived]).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== External Links ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Averaging.2FLayering.2FMasking|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>Ajk</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/Median</id>
		<title>Median</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Median"/>
				<updated>2017-02-18T12:16:03Z</updated>
		
		<summary type="html">&lt;p&gt;Ajk: Updated URLs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Plugins|Adjustment_filters|Averaging}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
| {{Author/ajk}}&lt;br /&gt;
| v0.6&lt;br /&gt;
|[http://ajk.pp.fi/avisynth/Median-0.6.zip Median-0.6.zip]&lt;br /&gt;
| Averaging&lt;br /&gt;
| ''Public domain. Credit would be nice, but do with this what you will.''&lt;br /&gt;
|6=[http://forum.doom9.org/showthread.php?t=170216 Doom9 Thread], [http://forum.videohelp.com/threads/362361-Median%28%29-plugin-for-AviSynth VideoHelp Thread]}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&amp;lt;tt&amp;gt;Median.dll&amp;lt;/tt&amp;gt; is a filter plugin for AviSynth which generates a pixel-by-pixel median of several clips. This is particularly useful for filtering out noise and glitches from multiple VHS/SVHS/8mm/Hi8 tape captures, but can be used for other purposes also.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/  greater]&lt;br /&gt;
* Supported color formats: [[YUY2]], [[YV12]], [[RGB32]], [[RGB24]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
&lt;br /&gt;
===Median===&lt;br /&gt;
Median() is the namesake function for this filter package. It takes a number of clips and outputs a frame which is the median of the input. Because for noise filtering applications having all the input clips exactly in sync is important, it also includes functionality to line up slight mismatches that can be present due to framedrops during capture.&lt;br /&gt;
:{{Template:FuncDef|Median (clip, clip, clip, ..., bool &amp;quot;chroma&amp;quot;, int &amp;quot;sync&amp;quot;, int &amp;quot;samples&amp;quot;, bool &amp;quot;debug&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clips between 3 and 25 are accepted. Odd number of clips is required.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|bool|true}}&lt;br /&gt;
:::Chroma is processed by default, but this can be turned off in which case the chroma from the first clip is used. In the case of RGB input, all colour planes are always processed. With RGB32 the chroma parameter can be used to turn off alpha channel processing.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|sync|int|0}}&lt;br /&gt;
:::If the clips are not exactly in sync, you can use this parameter to automatically line them up. The plugin will search up to this number of preceding and following frames to find the best match.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|samples|int|4096}}&lt;br /&gt;
:::Number of pixels to compare when determining similarity of frames for synchronization. The default seems to be fine most of the time but this parameter allows you to tweak the process.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debug|bool|false}}&lt;br /&gt;
:::Turns on debug output.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===MedianBlend===&lt;br /&gt;
There is also another, more flexible filter included, MedianBlend(). This function can be adjusted to for example return a clip derived from the minimum or maximum pixel values, or to discard some low (default: 1) and high (default: 1) values and blend the others together. With the paramteters set to not discard anything, the result is in fact the average of the clips. The other parameters work the same way as for Median().&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:{{Template:FuncDef|Median (clip, clip, clip, ..., int &amp;quot;low&amp;quot;, int &amp;quot;high&amp;quot;, bool &amp;quot;chroma&amp;quot;, int &amp;quot;sync&amp;quot;, int &amp;quot;samples&amp;quot;, bool &amp;quot;debug&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clips between 3 and 25 are accepted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|low|int|1}}&lt;br /&gt;
:::Number of low (dark) samples to discard.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|high|int|1}}&lt;br /&gt;
:::Number of high (light) samples to discard.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|bool|true}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|sync|int|0}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|samples|int|4096}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debug|bool|false}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===TemporalMedian===&lt;br /&gt;
You can also use the filter temporally on a single source clip. You can use a radius of up to 12 and the filter will take that many preceding and following frames into account when calculating the median. The other parameters work the same way as for Median().&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:{{Template:FuncDef|Median (clip, int &amp;quot;radius&amp;quot;, bool &amp;quot;chroma&amp;quot;, bool &amp;quot;debug&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clip.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|radius|int|1}}&lt;br /&gt;
:::Number of preceding and following frame to consider when calculating the median.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|bool|true}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debug|bool|false}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Examples == &lt;br /&gt;
Median of three clips, chroma is not processed:&lt;br /&gt;
 clip1 = AVISource(&amp;quot;capture1.avi&amp;quot;)&lt;br /&gt;
 clip2 = AVISource(&amp;quot;capture2.avi&amp;quot;)&lt;br /&gt;
 clip3 = AVISource(&amp;quot;capture3.avi&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
 Median(clip1,clip2,clip3, chroma=false)&lt;br /&gt;
Median of three clips, match frames up to 10 frames forward and back, print debug data on the image:&lt;br /&gt;
 Median(clip1,clip2,clip3, sync=10, debug=true)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Discard no values, output is an average function&lt;br /&gt;
  MedianBlend(clip1,clip2,clip3, low=0, high=0)&lt;br /&gt;
Discard highest values, output is a minimum function&lt;br /&gt;
 MedianBlend(clip1,clip2,clip3, low=0, high=2)&lt;br /&gt;
Discard lowest values, output is a maximum function&lt;br /&gt;
 MedianBlend(clip1,clip2,clip3, low=2, high=0)&lt;br /&gt;
Discard highest and lowest value and average the two remaining ones&lt;br /&gt;
 MedianBlend(clip1,clip2,clip3,clip4, low=1, high=1)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Median of five frames: current, two preceding, and two following:&lt;br /&gt;
 TemporalMedian(clip, radius=2)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version      Date            Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 v0.6         16/01/2016      - Added automatic clip synchronisation.&lt;br /&gt;
 v0.5         15/03/2014      - Fixed bug with chroma=false. Added TemporalMedian() functionality.&lt;br /&gt;
 v0.4         14/02/2014      - Added MedianBlend() functionality.&lt;br /&gt;
 v0.3         13/02/2014      - Fixed output frame buffer issue.&lt;br /&gt;
 v0.2         13/02/2014      - Added support for other colour spaces (planar and RBG24/32).&lt;br /&gt;
 v0.1         12/02/2014      - Initial release. YUY2 support only.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Archived Downloads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;; width=&amp;quot;600px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!!width=&amp;quot;100px&amp;quot;| Version&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Download&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Mirror&lt;br /&gt;
|-&lt;br /&gt;
!v0.6&lt;br /&gt;
|[http://http://ajk.kapsi.fi/projects/avisynth/median-plugin/Median-0.6.zip Median-0.6.zip]&lt;br /&gt;
|[http://web.archive.org/web/20160116120648/http://ajk.pp.fi/avisynth/Median-0.6.zip Median-0.6.zip]&lt;br /&gt;
|}&lt;br /&gt;
For older versions take a look at [http://ajk.kapsi.fi/projects/avisynth/median-plugin ajk's repository] ([http://web.archive.org/web/20170218121220/http://ajk.kapsi.fi/projects/avisynth/median-plugin/ archived]).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== External Links ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Averaging.2FLayering.2FMasking|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>Ajk</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/Median</id>
		<title>Median</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Median"/>
				<updated>2016-01-16T12:37:41Z</updated>
		
		<summary type="html">&lt;p&gt;Ajk: Updated for v0.6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Plugins|Adjustment_filters|Averaging}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
| {{Author/ajk}}&lt;br /&gt;
| v0.6&lt;br /&gt;
|[http://ajk.pp.fi/avisynth/Median-0.6.zip Median-0.6.zip]&lt;br /&gt;
| Averaging&lt;br /&gt;
| ''Public domain. Credit would be nice, but do with this what you will.''&lt;br /&gt;
|6=[http://forum.doom9.org/showthread.php?t=170216 Doom9 Thread], [http://forum.videohelp.com/threads/362361-Median%28%29-plugin-for-AviSynth VideoHelp Thread]}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&amp;lt;tt&amp;gt;Median.dll&amp;lt;/tt&amp;gt; is a filter plugin for AviSynth which generates a pixel-by-pixel median of several clips. This is particularly useful for filtering out noise and glitches from multiple VHS/SVHS/8mm/Hi8 tape captures, but can be used for other purposes also.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/  greater]&lt;br /&gt;
* Supported color formats: [[YUY2]], [[YV12]], [[RGB32]], [[RGB24]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
&lt;br /&gt;
===Median===&lt;br /&gt;
Median() is the namesake function for this filter package. It takes a number of clips and outputs a frame which is the median of the input. Because for noise filtering applications having all the input clips exactly in sync is important, it also includes functionality to line up slight mismatches that can be present due to framedrops during capture.&lt;br /&gt;
:{{Template:FuncDef|Median (clip, clip, clip, ..., bool &amp;quot;chroma&amp;quot;, int &amp;quot;sync&amp;quot;, int &amp;quot;samples&amp;quot;, bool &amp;quot;debug&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clips between 3 and 25 are accepted. Odd number of clips is required.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|bool|true}}&lt;br /&gt;
:::Chroma is processed by default, but this can be turned off in which case the chroma from the first clip is used. In the case of RGB input, all colour planes are always processed. With RGB32 the chroma parameter can be used to turn off alpha channel processing.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|sync|int|0}}&lt;br /&gt;
:::If the clips are not exactly in sync, you can use this parameter to automatically line them up. The plugin will search up to this number of preceding and following frames to find the best match.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|samples|int|4096}}&lt;br /&gt;
:::Number of pixels to compare when determining similarity of frames for synchronization. The default seems to be fine most of the time but this parameter allows you to tweak the process.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debug|bool|false}}&lt;br /&gt;
:::Turns on debug output.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===MedianBlend===&lt;br /&gt;
There is also another, more flexible filter included, MedianBlend(). This function can be adjusted to for example return a clip derived from the minimum or maximum pixel values, or to discard some low (default: 1) and high (default: 1) values and blend the others together. With the paramteters set to not discard anything, the result is in fact the average of the clips. The other parameters work the same way as for Median().&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:{{Template:FuncDef|Median (clip, clip, clip, ..., int &amp;quot;low&amp;quot;, int &amp;quot;high&amp;quot;, bool &amp;quot;chroma&amp;quot;, int &amp;quot;sync&amp;quot;, int &amp;quot;samples&amp;quot;, bool &amp;quot;debug&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clips between 3 and 25 are accepted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|low|int|1}}&lt;br /&gt;
:::Number of low (dark) samples to discard.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|high|int|1}}&lt;br /&gt;
:::Number of high (light) samples to discard.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|bool|true}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|sync|int|0}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|samples|int|4096}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debug|bool|false}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===TemporalMedian===&lt;br /&gt;
You can also use the filter temporally on a single source clip. You can use a radius of up to 12 and the filter will take that many preceding and following frames into account when calculating the median. The other parameters work the same way as for Median().&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:{{Template:FuncDef|Median (clip, int &amp;quot;radius&amp;quot;, bool &amp;quot;chroma&amp;quot;, bool &amp;quot;debug&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clip.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|radius|int|1}}&lt;br /&gt;
:::Number of preceding and following frame to consider when calculating the median.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|bool|true}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debug|bool|false}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Examples == &lt;br /&gt;
Median of three clips, chroma is not processed:&lt;br /&gt;
 clip1 = AVISource(&amp;quot;capture1.avi&amp;quot;)&lt;br /&gt;
 clip2 = AVISource(&amp;quot;capture2.avi&amp;quot;)&lt;br /&gt;
 clip3 = AVISource(&amp;quot;capture3.avi&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
 Median(clip1,clip2,clip3, chroma=false)&lt;br /&gt;
Median of three clips, match frames up to 10 frames forward and back, print debug data on the image:&lt;br /&gt;
 Median(clip1,clip2,clip3, sync=10, debug=true)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Discard no values, output is an average function&lt;br /&gt;
  MedianBlend(clip1,clip2,clip3, low=0, high=0)&lt;br /&gt;
Discard highest values, output is a minimum function&lt;br /&gt;
 MedianBlend(clip1,clip2,clip3, low=0, high=2)&lt;br /&gt;
Discard lowest values, output is a maximum function&lt;br /&gt;
 MedianBlend(clip1,clip2,clip3, low=2, high=0)&lt;br /&gt;
Discard highest and lowest value and average the two remaining ones&lt;br /&gt;
 MedianBlend(clip1,clip2,clip3,clip4, low=1, high=1)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Median of five frames: current, two preceding, and two following:&lt;br /&gt;
 TemporalMedian(clip, radius=2)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version      Date            Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 v0.6         16/01/2016      - Added automatic clip synchronisation.&lt;br /&gt;
 v0.5         15/03/2014      - Fixed bug with chroma=false. Added TemporalMedian() functionality.&lt;br /&gt;
 v0.4         14/02/2014      - Added MedianBlend() functionality.&lt;br /&gt;
 v0.3         13/02/2014      - Fixed output frame buffer issue.&lt;br /&gt;
 v0.2         13/02/2014      - Added support for other colour spaces (planar and RBG24/32).&lt;br /&gt;
 v0.1         12/02/2014      - Initial release. YUY2 support only.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Archived Downloads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;; width=&amp;quot;600px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!!width=&amp;quot;100px&amp;quot;| Version&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Download&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Mirror&lt;br /&gt;
|-&lt;br /&gt;
!v0.6&lt;br /&gt;
|[http://ajk.pp.fi/avisynth/Median-0.6.zip Median-0.6.zip]&lt;br /&gt;
|[http://web.archive.org/web/20160116120648/http://ajk.pp.fi/avisynth/Median-0.6.zip Median-0.6.zip]&lt;br /&gt;
|}&lt;br /&gt;
For older versions take a look at [http://ajk.pp.fi/avisynth ajk's repository] ([http://web.archive.org/web/20160116120648/http://ajk.pp.fi/avisynth/ archived]).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== External Links ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Averaging.2FLayering.2FMasking|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>Ajk</name></author>	</entry>

	</feed>