<?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_ReplaceBlackFrames</id>
	<title>Vapoursynth ReplaceBlackFrames - 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_ReplaceBlackFrames"/>
	<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_ReplaceBlackFrames&amp;action=history"/>
	<updated>2026-11-19T05:19:59Z</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_ReplaceBlackFrames&amp;diff=602&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_ReplaceBlackFrames&amp;diff=602&amp;oldid=prev"/>
		<updated>2026-11-16T08:51:44Z</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;ReplaceBlackFrames&amp;#039;&amp;#039;&amp;#039; finds frames whose average brightness is below a threshold and replaces them with the last non-black frame or with frames interpolated between the surrounding non-black frames.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Filtering → Vapoursynth → Frame → Replace&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapoursynth_ReplaceBlackFrames.png|none|ReplaceBlackFrames controls in Hybrid]]&lt;br /&gt;
&lt;br /&gt;
== What it does ==&lt;br /&gt;
The average of the first plane is measured for each frame; frames at or below &amp;#039;&amp;#039;Threshold&amp;#039;&amp;#039; count as black. With &amp;#039;&amp;#039;previous&amp;#039;&amp;#039; they are replaced by the last good frame; with the interpolating methods a run of black frames is rebuilt from the good frames before and after it. Black frames at the very start or end of the clip (with no good frame on one side) stay as they are.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* interpolateSVP, interpolateCPU: SVP must be installed (only then are they listed).&lt;br /&gt;
* interpolateRIFE: a Vulkan-capable GPU.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&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 || method || previous, interpolateSVP, interpolateCPU, interpolateRIFE || previous || Repeat the last good frame, or interpolate with SVP on the GPU, SVP on the CPU, or RIFE.&lt;br /&gt;
|-&lt;br /&gt;
| Threshold || thresh || 0.002 – 0.999 || 0.1 || Normalized average brightness (0 = black, 1 = white) at or below which a frame counts as black.&lt;br /&gt;
|-&lt;br /&gt;
| SC thresh || rifeSC || 0 – 1 || 0.15 || Scene change threshold for interpolateRIFE: if the frames before and after the black run differ by more, RIFE does not interpolate across the cut. 0 = off.&lt;br /&gt;
|-&lt;br /&gt;
| Debug || debug || on/off || off || Shows the average brightness of each frame in the preview.&lt;br /&gt;
|-&lt;br /&gt;
| Tools: SCD || – || scd, misc, std, mv || – || Scene change detection (only for interpolateRIFE with SC thresh above 0).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Default settings on a 10-bit YUV 4:2:0 source (640x356):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from ReplaceBlackFrames import ReplaceBlackFrames&lt;br /&gt;
rbf = ReplaceBlackFrames(clip=clip, tools={&amp;#039;scd&amp;#039;: &amp;#039;scd&amp;#039;})&lt;br /&gt;
clip = rbf.out&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How Hybrid calls it ==&lt;br /&gt;
* Color formats: previous works on any format, the SVP methods on 8-bit YUV 4:2:0, interpolateRIFE on 32-bit float RGB; the clip is converted as needed. ReplaceBlackFrames is not offered for interlaced material.&lt;br /&gt;
* Values are normalized and do not depend on the bit depth. Options are only written when they differ from the defaults.&lt;br /&gt;
* RIFE uses its default model (rife-v4.5 ensemble) without TTA or UHD.&lt;br /&gt;
* Replaced frames keep the frame properties (such as the frame duration) of the original frame.&lt;br /&gt;
* Frame count and frame rate do not change.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Threshold and video levels ===&lt;br /&gt;
The default 0.1 is about 25 on the 8-bit scale. In limited-range video black sits at 16 (about 0.063), so very dark frames that are not fully black can also count as black; lower the threshold if dark scenes are replaced.&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://github.com/styler00dollar/VapourSynth-RIFE-ncnn-Vulkan VapourSynth-RIFE-ncnn-Vulkan]&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>