Vapoursynth MFDIN

From wiki.selur.net
Revision as of 09:50, 16 November 2026 by Selur (talk | contribs) (New filter page (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

MFDIN (Multiframe Joint Enhancement for Early Interlaced Videos) is a neural-network deinterlacer that also cleans up typical artifacts of old interlaced video.

Filtering → (De-)Interlace/Telecine → Deinterlacer

MFDIN controls in Hybrid
MFDIN controls in Hybrid

What it does

MFDIN looks at three neighboring frames, deinterlaces them and restores detail in one step. It outputs either one frame per frame or one frame per field (double rate).

Requirements

  • Windows with the torch add-on and its MFDIN model; without it the entry is not offered.
  • An NVIDIA graphics card with CUDA. TensorRT is optional.

Settings

Control Parameter Range / values Hybrid default Meaning
Bob double_rate on/off off On: one frame per field (double rate); off: source rate.
TRT trt on/off off Use a TensorRT engine; it is built on first use and cached. Only enabled when Torch-TensorRT is installed.
FP16 – (input format) on/off off On: half-precision inference (16-bit float RGB input); off: 32-bit float.
Device device_index 0 – 16 0 Index of the GPU to use.

Example

Default settings on an 8-bit YUV 4:2:0 interlaced source (704x576, 25 fps, top field first):

# adjusting color space from YUV420P8 to RGBS for vsMFDIN
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_in_s="limited", range_s="full")
# deinterlace using MFDIN
from vsmfdin import mfdin
clip = mfdin(clip, device_index=0, double_rate=False, trt=False)
# set frame rate to 25fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)

How Hybrid calls it

  • The clip is converted to 16- or 32-bit float RGB (per FP16) and converted back later.
  • Field order: MFDIN only handles top field first. For bottom field first sources (detected scan type or Overwrite input scan type) Hybrid flips the picture vertically, which swaps the field parity, runs MFDIN as top field first and flips back.
  • Output frame rate: source rate, or double with Bob.
  • Afterwards the clip counts as progressive. No decimation.
  • MFDIN can also serve as the external interpolation (EdiExt "MFDIN(old)") of QTGMC.

Background

The VapourSynth package vsmfdin is HolyWu's port of anymyb's MFDIN and uses the "MFDIN_old_2P" model. It accepts only 16- or 32-bit float RGB, pads the frame internally to a multiple of 8 and needs PyTorch with CUDA (TensorRT support is optional).

Sources