Deinterlace Motion Heavy Video with FFmpeg Kerndeint

This guide explains how to use the kerndeint (Kernel Deinterlacer) filter in FFmpeg to effectively deinterlace videos containing high amounts of motion. You will learn the syntax of the filter, its key parameters, and practical command-line examples designed to eliminate interlacing artifacts—such as combing—while preserving motion clarity and edge sharpness.

Understanding the Kerndeint Filter

The kerndeint filter is a motion-adaptive deinterlacer that uses a kernel-based approach. Unlike basic deinterlacers that simply blend frames (causing motion blur) or discard fields (halving vertical resolution), kerndeint detects areas of motion and applies deinterlacing only where combing artifacts are present. This makes it highly effective for fast-moving content like sports or action footage.

Syntax and Parameters

The basic syntax for the filter is:

-vf "kerndeint=thresh:map:order:sharp:twoway"

To achieve the best results for highly motion-heavy video, you must configure these key parameters:

For a standard high-motion video (assuming Top Field First, which is common for HD interlaced footage), use the following FFmpeg command:

ffmpeg -i input.mp4 -vf "kerndeint=thresh=8:map=0:order=1:sharp=1:twoway=1" -c:v libx264 -preset slow -crf 18 -c:a copy output.mp4

Why this configuration works for high motion:

  1. thresh=8: Lowering the threshold from the default of 10 to 8 ensures that even subtle, fast-moving interlaced edges are captured and corrected.
  2. sharp=1: Prevents the video from looking soft or blurry during high-velocity camera pans.
  3. twoway=1: Sharply reduces temporal aliasing (flickering) by analyzing motion bidirectionally.

How to Fine-Tune the Filter

If you still notice combing artifacts or if the video looks too soft, use this two-step diagnostic process:

  1. Visualize the motion map: Run the command with map=1:

    ffmpeg -i input.mp4 -vf "kerndeint=thresh=8:map=1" -f matroska - | ffplay -

    Areas marked in white are being deinterlaced. If fast-moving edges are not white, lower the thresh value (e.g., to 5). If static areas are white, raise the thresh value (e.g., to 12) to prevent unnecessary filtering.

  2. Adjust Field Order: If the motion looks jittery or plays “one step forward, one step back,” your field order is likely inverted. Swap the order parameter (change order=1 to order=0 or vice versa).