What You’ll Learn
- How to deinterlace video with the
yadiffilter - Differences between
modevalues (0–3) - How to set field order with the
parityoption - How to tell whether a video is interlaced
- How deinterlacing affects frame rate and what to do about it
Verified: FFmpeg 8.1 on Windows — all 7 commands in this article were executed by the verification script and passed (2026-09-06). Platform: Windows / macOS / Linux
What is Interlacing?
Interlaced video splits each frame into odd lines (field 1) and even lines (field 2) and displays them alternately. The format is common in TV broadcasts (NTSC, PAL) and DV camera recordings.
Modern PC and smartphone displays are progressive, so playing interlaced video directly produces combing (interlace artifacts).
Basic Command
ffmpeg -i input.mp4 -vf yadif output.mp4
yadif defaults to mode=0 (one output frame per input frame).
The mode Option
ffmpeg -i input.mp4 -vf "yadif=mode=0" output.mp4
| mode | Behavior | Frame rate |
|---|---|---|
0 |
Output one frame per input frame | Unchanged |
1 |
Output one frame per field | Doubled |
2 |
Like mode=0, but checks frame type and only processes interlaced frames |
Unchanged |
3 |
Like mode=1, but checks frame type |
Up to doubled |
mode=0 is usually fine. Use mode=1 when you need 60i → 60p conversion.
60i → 30p (Halve the Frame Rate)
When converting Japanese TV broadcasts (1080i at 60Hz) to 30p:
ffmpeg -i input.mp4 -vf "yadif=mode=0" -r 30 output.mp4
60i → 60p (Preserve the Frame Rate)
ffmpeg -i input.mp4 -vf "yadif=mode=1" output.mp4
mode=1 emits one frame per field, producing 60fps progressive output.
The parity Option (Field Order)
ffmpeg -i input.mp4 -vf "yadif=mode=0:parity=0" output.mp4
| parity | Description |
|---|---|
-1 |
Auto-detect (default, recommended) |
0 |
BFF (Bottom Field First) — common in NTSC broadcasts |
1 |
TFF (Top Field First) — common in PAL broadcasts and DV |
-1 (auto) is usually the right choice.
How to Tell if Video is Interlaced
Use ffprobe to inspect the field order.
ffprobe -v quiet -show_streams -select_streams v:0 input.mp4 | grep field_order
If the output is tt (TFF), bb (BFF), tb, or bt, the video is interlaced. A progressive result means no deinterlacing is needed.
Higher-Quality Alternative to yadif
bwdif (Bob Weaver Deinterlacing Filter) produces better quality than yadif at the cost of more CPU:
ffmpeg -i input.mp4 -vf bwdif output.mp4
Measured: time and size
This is the command that was measured:
ffmpeg -i input.mp4 -vf yadif=mode=0:parity=-1 -c:v libx264 -crf 23 -preset medium -an output.mp4
| Measured | |
|---|---|
| Wall-clock time | 14 s (8.57x real time) |
| Output size | 67.94 MB |
| Size vs. the no-filter re-encode | -21.2% |
Rig: Core i9-14900KF (32 threads), FFmpeg 8.1 (gyan.dev), 2026-09-05, runs strictly sequential. The clip is 1920x1080, 30 fps, 120 s, 351.4 MB (Big Buck Bunny, looped, CC BY 3.0) — and the input here is that clip re-encoded as interlaced 1080i, not the progressive original. The no-filter re-encode used as the size reference (-c:v libx264 -crf 23 -preset medium, no -vf) took 27.97 s and produced 86.26 MB. Full data is in the dataset.
Why the number lands where it does
Adding a filter made the job finish sooner — 14 s against the 27.97 s no-filter re-encode. The size column explains it. yadif reconstructs each missing scan line by interpolating from the neighbouring field, and that interpolation is a smoothing operation: vertical high-frequency detail, combing artefacts included, does not survive it. x264 is then handed a picture with less to describe, so it spends fewer bits (-21.2%) and less time deciding how to spend them. Deinterlacing behaves less like an expensive pre-process and more like a step that makes the encode that follows cheaper.
What you cannot do is subtract 14 from 27.97 and call the difference “the cost of yadif”. The baseline read the progressive original; this run read a separate 1080i encode of the same footage, with its own bitrate and its own coding structure. The honest reading is the total: one full re-encode including deinterlacing, on this rig, on this clip, in 14 seconds.
The other thing worth seeing is that -c copy is not on the table here. In the same measurement run, operations that only remux streams finished in 0.41 s (stream mapping), 0.49 s (moov atom) and 1.03 s (audio fade). Everything that re-encodes ran from 14.0 s — this command — up to 729.16 s for a VP9 transcode. The moment a video filter enters the graph you leave the sub-second tier for good. Within the re-encoding tier, though, yadif sits at the cheap end: faster than a 720p downscale (18.43 s) and far faster than colour correction (53.26 s).
An earlier version of this page guessed “around 1.2–2x real time on a typical 8-core desktop”. That was a different class of machine, so it is not a strict refutation — but 120 seconds of video finished in 14 (8.57x real time), which is not the same order of magnitude. The guess is withdrawn.
These figures cover mode=0 only. mode=1 emits a frame per field, so its output frame count and its timing are a different question that this run did not answer.
Check fast-moving edges such as scrolling titles, arms, balls in sports footage, or horizontal camera movement. If field order is wrong, motion can appear to wobble back and forth; compare a short segment with parity=0 and parity=1.
Frequently Asked Questions
yadif vs bwdif vs nnedi — which deinterlacer is best?
bwdif is yadif’s improved successor and the modern default. nnedi (neural-net) produces the cleanest result but is much slower. yadif is fine for quick batch jobs.
Should I deinterlace 60i to 30p or 60p?
60p (one progressive frame per field, mode=1) preserves motion fluidity. 30p (mode=0) is half the framerate and looks choppier but matches typical web targets.
Can I detect whether a video is interlaced first?
Yes — ffmpeg -i in.mp4 -filter:v idet -f null - analyses 200 frames and reports BFF/TFF/progressive counts. Run only when interlaced flags exceed progressive.
Will deinterlacing harm progressive footage?
Slightly — deinterlacers blur or duplicate fields they cannot find. Use idet to gate the filter and apply only to confirmed-interlaced streams.
Does deinterlacing change the resolution?
No — output dimensions match the input. Only the field combination changes. If the source is 1080i (1920×1080 interlaced), the output is 1920×1080 progressive.
Related Articles
- Video Format Conversion — Containers and Codecs Explained
- Changing Frame Rate — -r vs. the fps Filter
Verified: FFmpeg 8.1 on Windows — all 7 commands in this article were executed by the verification script and passed (2026-09-06). Primary sources: ffmpeg.org/ffmpeg-filters.html#yadif / trac.ffmpeg.org/wiki/Deinterlacing