How to Use FFmpeg Yadif Filter to Deinterlace Video

Deinterlacing is a crucial step when converting older analog or broadcast video formats for playback on modern progressive displays. This article provides a straightforward guide on how to use the yadif (Yet Another Deinterlacing Filter) filter in FFmpeg, explaining its basic syntax, key parameters, and practical command-line examples to achieve high-quality video outputs.

What is the Yadif Filter?

Yadif stands for “Yet Another Deinterlacing Filter.” It is one of the most popular and highly effective CPU-based deinterlacing filters available in FFmpeg. It reconstructs interlaced frames into progressive ones by analyzing both spatial and temporal data in the video stream.

Basic Yadif Command

The simplest way to apply the yadif filter is by using the video filter flag (-vf) with its default settings:

ffmpeg -i input.mp4 -vf yadif output.mp4

By default, this command auto-detects the interlacing field order and outputs one progressive frame for every interlaced frame, maintaining the original frame rate (e.g., converting a 60i video into a 30p video).

Customizing Yadif Parameters

For more precise control, you can pass specific arguments to the filter using the format yadif=mode:parity:deint.

1. Mode (Output Frame Rate)

2. Parity (Field Order)

3. Deint (Which Frames to Deinterlace)


Practical Examples

Example 1: High-Quality Double Frame Rate (Bobbing)

To get the smoothest motion possible from sports broadcasts or home videos, you can double the frame rate by setting the mode to 1:

ffmpeg -i input.ts -vf yadif=mode=1:parity=-1:deint=0 -c:v libx264 -crf 18 -c:a copy output.mp4

(Shorthand equivalent: -vf yadif=1)

Example 2: Specifying Top Field First (TFF)

If the auto-detection fails and your output video looks jittery, you can explicitly force Top Field First:

ffmpeg -i input.mov -vf yadif=mode=0:parity=0:deint=0 output.mp4

(Shorthand equivalent: -vf yadif=0:0:0)

Using these configuration options allows you to handle any interlaced video source and convert it cleanly for modern digital playback.