How to Use the FFmpeg kerndeint Filter
This guide explains how to use the kerndeint (Kernel
Deinterlacer) filter in FFmpeg to deinterlace video footage. You will
learn the basic syntax of the filter, understand its key parameters such
as threshold and field order, and see practical command-line examples to
help you achieve clean, progressive video output.
What is the kerndeint Filter?
The kerndeint filter is a motion-adaptive deinterlacer.
Instead of deinterlacing the entire frame, it analyzes the video and
only applies deinterlacing to areas where motion is detected, preserving
the maximum amount of detail in static areas of the video.
Basic Syntax
The basic syntax for applying the kerndeint filter in an
FFmpeg command is as follows:
ffmpeg -i input.mp4 -vf "kerndeint=parameter1=value1:parameter2=value2" output.mp4If you want to use the default settings, you can simply call the filter by name:
ffmpeg -i input.mp4 -vf kerndeint output.mp4Filter Parameters
You can customize the deinterlacing behavior using the following parameters:
threshold: Sets the motion threshold (range 0 to 255). A lower threshold makes the filter more sensitive to motion, deinterlacing more of the image. The default value is10.order: Specifies the field order of the input video.0: Bottom Field First (BFF)1: Top Field First (TFF)- The default value is
0.
map: Used for debugging. If set to1, the filter paints deinterlaced pixels white, allowing you to see exactly which parts of the frame are being modified. The default value is0(disabled).sharp: Enables additional sharpening.0: Disable sharpening (default)1: Enable sharpening
twoway: Enables two-way sharpening.0: Disable two-way sharpening (default)1: Enable two-way sharpening
Practical Examples
Example 1: Standard Deinterlacing with Default Settings
To deinterlace a video using the default parameters (threshold of 10, bottom field first, no sharpening):
ffmpeg -i input.ts -vf kerndeint output.mp4Example 2: Deinterlacing Top Field First (TFF) Video with Custom Threshold
If your source video is Top Field First (common for 1080i HD video) and you want a more sensitive motion threshold of 8 to capture subtle movement:
ffmpeg -i input.mts -vf "kerndeint=threshold=8:order=1" output.mp4Example 3: Enabling Sharpening
To deinterlace a video while applying the built-in sharpening tool to keep the moving edges crisp:
ffmpeg -i input.ts -vf "kerndeint=sharp=1" output.mp4Example 4: Visualizing the Deinterlaced Areas (Map Mode)
To check which parts of your video frame are being affected by the filter, run the command with the map parameter enabled:
ffmpeg -i input.ts -vf "kerndeint=map=1" output_map.mp4In the output video, all deinterlaced pixels will appear bright
white, helping you adjust the threshold value to your
liking.