Deinterlace
37c3317fd058; modified for Encode Wiki · CC BY-SA 4.0Interlaced video stores each frame as two fields captured a moment apart, one holding the odd lines and the other the even lines. A 1080i or 576i broadcast, a DVD or a camcorder recording carries 50 or 59.94 fields per second this way. Shown as a single frame, any moving edge looks like a comb. Deinterlacing rebuilds full progressive frames from the fields.
Before you deinterlace, work out what you actually have, because three different things get called “interlaced”:
| Source | What it looks like | What to do |
|---|---|---|
| True interlaced (video camera, sports, live TV) | Every moving frame is combed; each field is a separate moment in time | Deinterlace, as on this page |
| Telecined film (NTSC DVDs of movies, some anime) | A repeating pattern of three clean frames and two combed ones in every five | Inverse telecine, which gets back the original 24 progressive frames |
| Progressive content stored as fields (most PAL film DVDs, 25p as 50i) | Combing only when the fields are mismatched; matching them gives clean frames | Field-match and weave; no interpolation needed |
Deinterlacing telecined or already-progressive material throws away detail for nothing. Mixed sources and leftover combing are covered in decombing.
Check the source
Section titled “Check the source”FFmpeg’s idet classifies frames. Run it over part of the video that has motion:
ffmpeg -ss 600 -t 30 -i input.mkv -vf idet -f null -The summary reports how many frames are top field first (TFF), bottom field first (BFF) and progressive, plus a “Repeated Fields” line whose Top/Bottom counts are the sign of telecine. Mostly TFF or BFF with no repeated fields means true interlaced. Then step through a few moving frames in a previewer to confirm: you should see combing, and in true interlaced video each field-to-field step has fresh motion.
Container flags are often wrong, especially on DVD rips, so don’t rely on them alone. Field order matters: if you deinterlace with the wrong order, motion steps backward and forward and looks jerky. When idet and the container disagree, test both on a clip with a pan and keep the smooth one.
Single rate or double rate
Section titled “Single rate or double rate”A deinterlacer can output one frame per frame (25 or 29.97 fps, a “single-rate” or send_frame result), or one frame per field (50 or 59.94 fps, “double rate” or “bob”). Double rate keeps all the motion the source captured and is what you want for sports and anything with fast movement, but it needs a higher-framerate encode and player support. Single rate discards half the temporal information; it is a fine choice when you need to stay at the source frame rate and the motion is moderate.
FFmpeg
Section titled “FFmpeg”bwdif is the usual FFmpeg choice: a motion-adaptive deinterlacer based on yadif, with w3fdif and cubic interpolation added. It outputs double rate by default:
ffmpeg -i input.mkv -vf bwdif -c:v libx264 -crf 18 output.mkvAdd mode=send_frame for single rate. Field order is detected from the stream; if that is wrong, set it with parity=tff or parity=bff. Leave deint alone unless you want to touch only frames flagged as interlaced, which trusts the flags.
yadif is the older filter with similar options, and it defaults to single rate. FFmpeg’s nnedi filter needs a separate weights file. For a one-off conversion any of these is adequate; use VapourSynth when you want better quality or control.
Deinterlace before scaling or any filter that mixes lines, since resizing blends the two fields together.
VapourSynth
Section titled “VapourSynth”QTGMC is the community’s highest-quality deinterlacer: motion-compensated, with built-in noise handling and temporal stabilisation, and much slower than FFmpeg’s filters. In vs-jetpack it is QTempGaussMC in vsdeinterlace. The havsfunc package no longer provides QTGMC, and its parameter names differ from the new implementation (there is a mapping).
from vsdeinterlace import QTempGaussMC
clip = QTempGaussMC().deinterlace(clip, tff=True)That returns double rate. For single rate, QTGMC’s motion-blur stage can divide the frame rate:
clip = QTempGaussMC().motion_blur(fps_divisor=2).deinterlace(clip, tff=True)If tff is omitted it is read from the clip’s _FieldBased property, so set it yourself when you aren’t sure the source filter marked it correctly. For something lighter, vsaa has plain bobbers:
from vsaa import NNEDI3, BWDIF
clip = NNEDI3().deinterlace(clip, tff=True, double_rate=True)clip = BWDIF().deinterlace(clip, tff=True, double_rate=True)NNEDI3 interpolates only the missing lines of each field with a neural network and is much quicker than QTGMC, though it doesn’t clean up temporal artefacts the way QTGMC does.
Check the result
Section titled “Check the result”Look at scrolling text, thin horizontal lines and fast pans. Remaining combing means the wrong field order or a missed mode; shimmering thin lines are normal single-pass bobbing and what QTGMC’s stabilisation exists to reduce. If the frame count of your output isn’t what you expected (double rate doubles it), check it with ffprobe before encoding.