<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_TemporalDegrain2</id>
	<title>Vapoursynth TemporalDegrain2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_TemporalDegrain2"/>
	<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_TemporalDegrain2&amp;action=history"/>
	<updated>2026-11-19T04:05:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_TemporalDegrain2&amp;diff=649&amp;oldid=prev</id>
		<title>Selur: Update to current Hybrid behaviour; code as &lt;pre&gt; (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_TemporalDegrain2&amp;diff=649&amp;oldid=prev"/>
		<updated>2026-11-16T08:53:24Z</updated>

		<summary type="html">&lt;p&gt;Update to current Hybrid behaviour; code as &amp;lt;pre&amp;gt; (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:53, 16 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l77&quot;&gt;Line 77:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 77:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Default settings on a 10-bit YUV 4:2:0 source:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Default settings on a 10-bit YUV 4:2:0 source:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight lang=&quot;python&quot;&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# removing grain using TemporalDegrain2&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# removing grain using TemporalDegrain2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = degrain.TemporalDegrain2(clip, degrainPlane=4, postFFT=0, fftThreads=1, SrchClipPP=3, tools={&amp;#039;mv&amp;#039;: &amp;#039;mvutensils&amp;#039;, &amp;#039;expr&amp;#039;: &amp;#039;akarin&amp;#039;, &amp;#039;dfttest&amp;#039;: &amp;#039;neo_fft&amp;#039;, &amp;#039;nlmeans&amp;#039;: &amp;#039;knlm&amp;#039;, &amp;#039;rg&amp;#039;: &amp;#039;zsmooth&amp;#039;, &amp;#039;median&amp;#039;: &amp;#039;zsmooth&amp;#039;, &amp;#039;tcanny&amp;#039;: &amp;#039;tcanny&amp;#039;, &amp;#039;fft3d&amp;#039;: &amp;#039;neo_fft&amp;#039;})&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = degrain.TemporalDegrain2(clip, degrainPlane=4, postFFT=0, fftThreads=1, SrchClipPP=3, tools={&amp;#039;mv&amp;#039;: &amp;#039;mvutensils&amp;#039;, &amp;#039;expr&amp;#039;: &amp;#039;akarin&amp;#039;, &amp;#039;dfttest&amp;#039;: &amp;#039;neo_fft&amp;#039;, &amp;#039;nlmeans&amp;#039;: &amp;#039;knlm&amp;#039;, &amp;#039;rg&amp;#039;: &amp;#039;zsmooth&amp;#039;, &amp;#039;median&amp;#039;: &amp;#039;zsmooth&amp;#039;, &amp;#039;tcanny&amp;#039;: &amp;#039;tcanny&amp;#039;, &amp;#039;fft3d&amp;#039;: &amp;#039;neo_fft&amp;#039;})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== How Hybrid calls it ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== How Hybrid calls it ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_TemporalDegrain2&amp;diff=192&amp;oldid=prev</id>
		<title>Selur: New filter page (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_TemporalDegrain2&amp;diff=192&amp;oldid=prev"/>
		<updated>2026-11-14T19:51:56Z</updated>

		<summary type="html">&lt;p&gt;New filter page (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin:0 0 1em 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;TemporalDegrain2&amp;#039;&amp;#039;&amp;#039; is ErazorTT&amp;#039;s improved TemporalDegrain: a strong temporal degrainer with QTGMC-style motion estimation, two motion-compensated degrain stages, an optional motion-compensated post denoiser and contra-sharpening. It handles low-contrast areas and diverging motion better than the original.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Filtering → Vapoursynth → DeGrain&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapoursynth_TemporalDegrain2.png|none|TemporalDegrain2 controls in Hybrid]]&lt;br /&gt;
&lt;br /&gt;
== What it does ==&lt;br /&gt;
# A blurred, gamma-adjusted search clip is built and the motion is searched on it (with global motion and lambda tuning as in QTGMC).&lt;br /&gt;
# Stage 1: MDegrain, limited to what an FFT3D &amp;quot;limit&amp;quot; clip changes.&lt;br /&gt;
# Stage 2: a second MDegrain.&lt;br /&gt;
# Optionally a motion-compensated post denoiser (FFT3D, DFTTest or KNLMeansCL) and a contra-sharpening.&lt;br /&gt;
Most thresholds follow &amp;#039;&amp;#039;GrainLevel&amp;#039;&amp;#039; unless they are set by hand.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DeGrain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control !! Parameter !! Range / values !! Hybrid default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| Radius || degrainTR || 0 – 3 || 1 || Frames on each side for the degrain stages; 0 = no MDegrain. More than about fps/8 rarely helps.&lt;br /&gt;
|-&lt;br /&gt;
| Planes || degrainPlane || all, luma only, chroma only || all || Planes that are degrained (chroma only = both chroma planes).&lt;br /&gt;
|-&lt;br /&gt;
| GrainLevel || grainLevel || -2 – 3 || 2 || Sets the automatic SAD/SCD thresholds, search clip and limit values.&lt;br /&gt;
|-&lt;br /&gt;
| GrainLevelSetup || grainLevelSetup || on/off || off || Setup aid: shows stage 0 with radius 3 to choose the grain level; ignores the other settings.&lt;br /&gt;
|-&lt;br /&gt;
| SAD1 / SAD2 || ppSAD1, ppSAD2 || 2 – 64000 || automatic (11 / 7 at grain level 2) || Per-pixel SAD thresholds of the two stages; set by hand with the check box.&lt;br /&gt;
|-&lt;br /&gt;
| SCD1 / SCD2 || ppSCD1, thSCD2 || 1 – 255 || automatic (5 at grain level 2) / 128 || Scene change thresholds; SCD2 on a 0–255 scale (128 ≈ 50 %).&lt;br /&gt;
|-&lt;br /&gt;
| Limit sigma || limitSigma || 0 – 40 || automatic || Strength of the FFT3D limit clip; by hand with the check box. Automatically chosen from the resolution and grain level.&lt;br /&gt;
|-&lt;br /&gt;
| Limit blocksize || limitBlksz || 4, 8, 12, 16, 24, 32, 64, 96 || automatic || Block size of the FFT3D limit clip; by hand with the check box.&lt;br /&gt;
|-&lt;br /&gt;
| DCT || DCT || 11 MVTools DCT modes || usual spatial blocks || Block comparison mode; with SATD the SAD thresholds are raised by 1.7.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Motion Estimation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control !! Parameter !! Range / values !! Hybrid default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| Algo || meAlg || onetime, nStep, logarithmic, exhaustive, hexagon, UMH, pure horizontal, pure vertical || hexagon || Search algorithm.&lt;br /&gt;
|-&lt;br /&gt;
| Algo param. || meAlgPar || 1 – 64 || automatic (2) || Search range parameter; by hand with the check box.&lt;br /&gt;
|-&lt;br /&gt;
| Subpixel search || meSubpel || 1, 2, 4 || automatic || Subpixel accuracy; automatically 4 for SD, 2 for HD, 1 above 1080p.&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize || meBlksz || 4 – 128 || automatic || Block size; automatically 8 up to 720p, 16 for 1080p, 32 above.&lt;br /&gt;
|-&lt;br /&gt;
| TM / Chroma / Global / Recalculate || meTM, ChromaMotion, GlobalMotion, rec || on/off || off / on / on / off || Truemotion, chroma in the search, global motion, refinement pass.&lt;br /&gt;
|-&lt;br /&gt;
| Search clip || SrchClipPP || 0 – 3 || 3 || Search clip preprocessing: 0 none, 1 bilinear blur, 2 TCanny blur, 3 blur with limited merge.&lt;br /&gt;
|-&lt;br /&gt;
| Subpixel interp. || SubPelInterp || soft, bicubic, sharper Wiener || sharper Wiener || Interpolation for the subpixel search.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Post-processing&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control !! Parameter !! Range / values !! Hybrid default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| Method || postFFT || none, FFT3D, DFTTest, KNLMeansCL || none || Post denoiser after the degrain stages.&lt;br /&gt;
|-&lt;br /&gt;
| Radius || postTR || 0 (spatial only), 1 (3 frames), 2 (5 frames), 3 (7 frames) || 1 (3 frames) || Temporal radius of the post denoiser; FFT3D allows at most 2.&lt;br /&gt;
|-&lt;br /&gt;
| Sigma || postSigma || 0 – 40 || 1 || Strength of the post denoiser.&lt;br /&gt;
|-&lt;br /&gt;
| FFT threads || fftThreads || 1 – 16 || 1 || Threads for the FFT3D limit and post filters.&lt;br /&gt;
|-&lt;br /&gt;
| DeviceID || knlDevId || 0 – 4 || 0 || GPU for KNLMeansCL.&lt;br /&gt;
|-&lt;br /&gt;
| Sharpen || extraSharp || on/off || off || Stronger contra-sharpening (radius 3 instead of 1).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tools&amp;#039;&amp;#039;&amp;#039;: MV (mvutensils, mv, mvgpu), Expr (akarin, cranexpr, std), RG (zsmooth, neo_smo), Median (zsmooth), FFT3D (neo_fft), DFTTest, NLMeans and TCanny implementations.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Default settings on a 10-bit YUV 4:2:0 source:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# removing grain using TemporalDegrain2&lt;br /&gt;
clip = degrain.TemporalDegrain2(clip, degrainPlane=4, postFFT=0, fftThreads=1, SrchClipPP=3, tools={&amp;#039;mv&amp;#039;: &amp;#039;mvutensils&amp;#039;, &amp;#039;expr&amp;#039;: &amp;#039;akarin&amp;#039;, &amp;#039;dfttest&amp;#039;: &amp;#039;neo_fft&amp;#039;, &amp;#039;nlmeans&amp;#039;: &amp;#039;knlm&amp;#039;, &amp;#039;rg&amp;#039;: &amp;#039;zsmooth&amp;#039;, &amp;#039;median&amp;#039;: &amp;#039;zsmooth&amp;#039;, &amp;#039;tcanny&amp;#039;: &amp;#039;tcanny&amp;#039;, &amp;#039;fft3d&amp;#039;: &amp;#039;neo_fft&amp;#039;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How Hybrid calls it ==&lt;br /&gt;
* TemporalDegrain2 works on 8–16-bit integer YUV and gray clips; interlaced material is handled by Hybrid&amp;#039;s general field handling.&lt;br /&gt;
* Values behind a check box are written whenever the check box is ticked; the search clip setting, planes, post method and FFT threads are always written; other values only when they differ from the defaults.&lt;br /&gt;
* The limit settings are disabled with radius 0, the post radius and sigma without a post method.&lt;br /&gt;
* TemporalDegrain2 also offers the [[Vapoursynth common filter options|common options]] (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== The script ===&lt;br /&gt;
The VapourSynth port follows ErazorTT&amp;#039;s AviSynth TemporalDegrain v2 (doom9 thread &amp;quot;TemporalDegrainV2&amp;quot;, 2018). Its recommendation: start with the defaults; for strong cleaning find the noisiest area, use GrainLevelSetup to choose a grain level from 0 to 3, then try the FFT3D post denoiser with a sigma around 1. For more, raise the radius rather than the sigma; above sigma 3, or when banding appears, use DFTTest.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* [https://github.com/Selur/VapoursynthScriptsInHybrid VapoursynthScriptsInHybrid] (the script collection Hybrid uses)&lt;br /&gt;
* [https://forum.doom9.org/showthread.php?t=175798 doom9 thread &amp;quot;TemporalDegrainV2&amp;quot;]&lt;br /&gt;
* Hybrid&amp;#039;s tooltips&lt;br /&gt;
&lt;br /&gt;
[[Category:Vapoursynth Filters]]&lt;/div&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
</feed>