Improving Old Video Quality: Yadif Settings That WorkRestoring and improving old interlaced video (VHS transfers, broadcast captures, archival footage) often starts with deinterlacing. One well-known tool for that is YADIF (Yet Another DeInterlacing Filter), an open-source deinterlacer used in FFmpeg and many video-processing workflows. This article explains how YADIF works, which settings matter, and practical workflows to get the best result from vintage footage while minimizing artifacts.
What YADIF does and when to use it
YADIF converts interlaced frames (which contain two fields captured at slightly different times) into progressive frames. It’s a frame-rate preserving deinterlacer by default, producing one progressive frame for every input frame (useful when each input frame already contains both fields). YADIF is fast, widely available in FFmpeg builds, and gives good results on many kinds of material, especially when combined with other preprocessing (denoising, chroma handling) and postprocessing (sharpening, temporal smoothing).
Use YADIF when:
- Your source is interlaced (often flagged as “interlaced” or showing combing during motion).
- You need a fast, good-quality deinterlacer for general-purpose restoration.
- You want a simple, scriptable FFmpeg-based workflow.
YADIF is not always the best choice for every clip: for cinema-like motion, motion-compensated deinterlacers (e.g., QTGMC in AviSynth/MVTools2) can yield higher quality at much greater computational cost.
How YADIF works (brief)
YADIF analyzes motion between fields and produces progressive frames by interpolating missing lines when necessary. Key parameters:
- mode: duplicate fields or produce double frame rate — affects temporal behavior.
- parity: tells YADIF which field is first (top or bottom).
- deint_mode flag: enables different processing options (usually 0 or 1).
In FFmpeg, YADIF is typically invoked like:
-vf yadif=mode:parity:deint_mode
Default behavior is yadif=0:-1:0 (automatic field parity detection, single-rate output).
Important settings and what they do
-
mode (0, 1, 2):
- 0 — single-rate (output one frame per input frame). Good when input frames already contain both fields or when preserving original frame rate.
- 1 — double-rate (output two frames per input frame). Produces smoother motion by creating one frame per field (doubles frame rate); useful if you want to retain temporal detail with less flicker.
- 2 — single-rate but force top/bottom field? (less commonly used; check FFmpeg docs for version-specific details).
-
parity (0, 1, -1):
- 0 — top-field-first
- 1 — bottom-field-first
- -1 — auto-detect (useful when container metadata is unreliable)
-
deint_mode (0 or 1):
- 0 — standard (faster)
- 1 — slower, may reduce some artifacts (experiment to see if it helps)
Practical defaults: yadif=mode=1:parity=-1:deint_mode=0 when you want smoother motion (double-rate), or yadif=0:-1:0 for a simpler, single-rate pass.
Typical FFmpeg command examples
-
Single-rate, auto parity (fast):
ffmpeg -i input.mp4 -vf yadif=0:-1:0 -c:v libx264 -crf 18 -preset medium output.mp4
-
Double-rate for smoother motion (creates 2× frame count):
ffmpeg -i input.mp4 -vf yadif=1:-1:0 -c:v libx264 -crf 18 -preset medium output_double.mp4
-
Force parity if you know field order (avoid combing):
ffmpeg -i input.mp4 -vf yadif=0:0:0 -c:v libx264 -crf 18 output_topfirst.mp4
Note: When using double-rate, consider filtering or re-encoding to a framerate that your delivery device supports (e.g., drop duplicate frames or resample to 60fps/50fps as appropriate).
Preprocessing steps before YADIF
-
De-noise first: Old footage often has noise and dust which confuses deinterlacers. Apply a temporal and/or spatial denoiser before YADIF.
- FFmpeg example: use the NLMeans or hqdn3d filters:
-vf hqdn3d=3:2:2:3,yadif=0:-1:0
- FFmpeg example: use the NLMeans or hqdn3d filters:
-
Fix color/chroma: Many transfers have chroma noise. Use chroma smoothing or convert to a higher bit-depth colorspace to avoid banding:
- Convert to 16-bit before heavy filters:
-vf format=gbrpf32le, ...
- Convert to 16-bit before heavy filters:
-
Crop and stabilize: Remove edge noise and fix jitter prior to deinterlacing if necessary.
Postprocessing after YADIF
-
Sharpen carefully: Deinterlacing can soften images. Use mild unsharp filters or more advanced sharpening (e.g., masked sharpen) to avoid accentuating noise.
- Example with unsharp:
-vf yadif=0:-1:0,unsharp=5:5:0.8:3:3:0.4
- Example with unsharp:
-
Temporal smoothing: If double-rate output shows micro-judder, consider frame-blending or temporal denoise to smooth motion.
-
Color grading and LUTs: Restore contrast and color after deinterlacing; YADIF can slightly change perceived sharpness and color balance.
Practical workflow examples
Workflow A — basic VHS cleanup (fast)
- Convert to a high-bit format, denoise, deinterlace, encode:
ffmpeg -i tape.mkv -vf hqdn3d=4:3:6:4,yadif=0:-1:0 -c:v libx264 -crf 17 -preset slow output.mp4
Workflow B — higher-quality archival pass
- Convert to 10- or 16-bit intermediate, denoise with NLMeans, deinterlace (double-rate), then optical-flow frame-rate conversion if needed:
ffmpeg -i tape.mkv -vf format=yuv420p10le,atadenoise=nlmeans=... ,yadif=1:-1:1 -c:v libx265 -pix_fmt yuv420p10le -crf 16 output_highbit.mp4
(Replace nlmeans parameters with tuned values for your footage.)
Workflow C — when combing remains (force parity)
- If you see combing during motion, try forcing parity:
ffmpeg -i input.mkv -vf yadif=0:1:0 -c:v libx264 -crf 18 output_fixed.mp4
When to prefer other deinterlacers
- QTGMC (AviSynth): produces superior, motion-compensated results at significant CPU cost. Use for archival restorations where quality is paramount.
- Temporally-aware upscalers: some modern AI-based upscalers include integrated deinterlacing with motion compensation and can outperform YADIF for difficult material.
- If you need minimal artifacts and have time/resources, run a comparison: YADIF vs QTGMC vs an AI deinterlacer on a test clip.
Troubleshooting common issues
- Combing remains on fast motion: try forcing parity (0 or 1) or use double-rate mode. If persistent, try a motion-compensated deinterlacer.
- Flicker or field jitter: check source field order and choose correct parity; stabilize before deinterlacing.
- Excessive noise after deinterlacing: denoise more aggressively before YADIF, or apply temporal denoise after.
- Chroma artifacts: work in higher bit-depth and apply chroma denoising or separate chroma processing.
Quick reference (recommended starting points)
- Fast general-purpose: yadif=0:-1:0
- Smooth motion (double-rate): yadif=1:-1:0
- If combing visible, force parity: yadif=0:0:0 (top-field-first) or yadif=0:1:0 (bottom-field-first)
- Consider pre-denoise (hqdn3d) and post-sharpening (unsharp)
Final notes
YADIF is a practical, fast, and effective deinterlacer for many legacy sources. Best results come from treating deinterlacing as one step in a pipeline: preprocessing (denoise, color/chroma fixes), deinterlacing with tuned YADIF settings, then postprocessing (sharpen, grade). For mission-critical or archival restorations, compare YADIF against motion-compensated and AI-based deinterlacers and choose the best fit for quality vs. time/resources.
Leave a Reply