Deinterlace Field-Matching Frames with FFmpeg Yadif

This article explains how to use the yadif (Yet Another Deinterlacing Filter) filter in FFmpeg to selectively deinterlace field-matching frames. You will learn how to combine the fieldmatch and yadif filters in a single filtergraph to deinterlace only the frames that contain residual combing artifacts, preserving the original quality of perfectly matched progressive frames.

When processing telecined or mixed-content video, the fieldmatch filter attempts to reconstruct progressive frames by matching fields from adjacent frames. However, some frames cannot be perfectly matched and will still exhibit interlaced “combing” artifacts. To resolve this, you can use yadif as a post-processing step that target-deinterlaces only these unmatched, combed frames.

The key to this process is the deint parameter in the yadif filter. By setting this parameter to interlaced (or 1), you instruct yadif to check the frame metadata and only apply deinterlacing to frames that fieldmatch has flagged as interlaced.

The FFmpeg Command Syntax

To implement this workflow, chain the fieldmatch and yadif filters together using the following command-line template:

ffmpeg -i input.mp4 -vf "fieldmatch=order=tff,yadif=deint=interlaced" -c:v libx264 -crf 18 -c:a copy output.mp4

Parameter Breakdown

Using this combination ensures maximum sharpness for the majority of your video while cleanly eliminating combing artifacts on frames that failed the field-matching process.