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
Tested with: FFmpeg 6.1 (ubuntu-latest / CI verified)
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
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
Tested with ffmpeg 6.1 / Ubuntu 24.04 (GitHub Actions runner) Primary sources: ffmpeg.org/ffmpeg-filters.html#yadif / trac.ffmpeg.org/wiki/Deinterlacing