Vapoursynth FillDrops

From wiki.selur.net
Jump to navigation Jump to search

FillDrops finds single frames that repeat their predecessor because the real frame was lost (a "drop") and replaces them with a frame interpolated from their two neighbors.

Filtering → Vapoursynth → Frame → Replace

FillDrops controls in Hybrid
FillDrops controls in Hybrid

What it does

A frame counts as a duplicate when its luma differs from the previous frame by no more than Threshold. FillDrops only handles isolated duplicates: the frame before must not be a duplicate itself, and the frames around it must not be a scene change. The duplicate is then rebuilt by interpolating between the frames before and after it. Runs of several repeated frames are left alone – use FillDuplicateFrames for those.

Requirements

  • svp, svp_gpu: SVP must be installed (only then are they listed).
  • rife: a Vulkan-capable GPU.
  • mv: CPU; the mvgpu implementation needs Vulkan.

Settings

Control Parameter Range / values Hybrid default Meaning
Threshold thresh 0.0001 – 1 0.001 Largest normalized luma difference to the previous frame that still counts as a duplicate. Must stay below SCD, otherwise nothing is replaced.
Method method mv, svp, svp_gpu, rife svp (mv without SVP) Interpolator: MVTools, SVP on the CPU, SVP on the GPU, or RIFE. Without SVP the svp methods are not offered.
SCD sceneThr 0 – 1 0.15 Scene change threshold (normalized luma difference) for all methods; nothing is interpolated across a cut. 0 = off.
RIFE: Model – RIFE models rife-v4.5 (ensemble) RIFE model (method rife).
RIFE: TTA / UHD – on/off off / off Test-time augmentation (not available for v4 models); UHD mode for large frames (method rife).
Debug debug on/off off Shows the detection in the preview.
Tools: MV – mvgpu, mvutensils, mv – MVTools implementation (method mv).

Example

Default settings on a 10-bit YUV 4:2:0 source (640x356):

# adjusting color space from YUV420P10 to YUV420P8 for vsFillDrops
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, dither_type="error_diffusion")
from FillDuplicateFrames import FillDuplicateFrames
fdf = FillDuplicateFrames(clip=clip, mode="FillDrops", method="svp", tools={'mv': 'mvutensils'})
clip = fdf.out

How Hybrid calls it

  • Color formats: svp and svp_gpu work on 8-bit YUV 4:2:0, mv on 8–16-bit YUV, rife on 32-bit float RGB; the clip is converted as needed. FillDrops is not offered for interlaced material.
  • Threshold and SCD are normalized values and do not depend on the bit depth. Options are only written when they differ from the defaults; RIFE options only for method rife.
  • Replaced frames keep the frame properties (such as the frame duration) of the original frame.
  • Frame count and frame rate do not change.

Background

Origin

The name comes from Didée's AviSynth script FillDrops. Hybrid's Vapoursynth version shares its detection and interpolation with FillDuplicateFrames and ReplaceSingle.

Sources