How to Deinterlace Video with FFmpeg BWDIF
This article provides a quick and practical guide on how to
deinterlace interlaced video files using FFmpeg’s high-quality
bwdif (Bob Weaver Deinterlacing Filter). You will learn the
basic command syntax, how the filter parameters work, and how to choose
between outputting standard framerate or double framerate (bobbing) for
smoother motion.
Why Use the BWDIF Filter?
The bwdif filter is a modern, motion-adaptive
deinterlacing filter in FFmpeg. It is based on the popular
yadif (Yet Another Deinterlacing Filter) but incorporates
algorithms from the Weston 3D deinterlacer. This combination results in
significantly better image quality, fewer visual artifacts, and sharper
edges than older deinterlacing methods, while still maintaining fast
processing speeds.
Basic Command Syntax
The most straightforward way to apply the bwdif filter
is to use the -vf (video filter) flag in your FFmpeg
command:
ffmpeg -i input.mp4 -vf bwdif output.mp4This command uses the default settings of bwdif, which
automatically detects the field order (top field first or bottom field
first) and outputs one progressive frame for each interlaced frame
(maintaining the original framerate).
Fine-Tuning BWDIF Parameters
To get the best results, you can customize the three primary
parameters of the bwdif filter: mode,
parity, and deint. The syntax for specifying
these options is bwdif=mode:parity:deint.
1. Mode (Framerate Options)
The mode parameter determines how many frames are output
per second: * 0 (or
send_frame): Outputs 1 frame for each input frame.
(Standard framerate, e.g., 30i becomes 30p). * 1
(or send_field): Outputs 1 frame for each input
field. This is known as “bobbing” and doubles the framerate (e.g.,
30i/60 fields per second becomes 60p), resulting in much smoother
motion.
2. Parity (Field Order)
The parity parameter specifies which field is processed
first. While FFmpeg usually detects this automatically, you can set it
manually if the auto-detection fails: * -1 (or
auto): Automatic detection (default). *
0 (or tff): Top field first.
* 1 (or bff): Bottom field
first.
3. Deint (Deinterlacing Target)
The deint parameter controls which frames the filter
processes: * 0 (or all):
Deinterlaces all frames (default). * 1 (or
interlaced): Only deinterlaces frames that are
flagged as interlaced.
Actionable Examples
Example 1: High-Quality Double Framerate (Smooth Motion)
To achieve the smoothest playback for sports or fast-moving footage, double the framerate by sending one frame per field:
ffmpeg -i input.ts -vf bwdif=mode=send_field:parity=auto:deint=all -c:v libx264 -crf 20 -c:a copy output.mp4(Alternative short syntax:
-vf bwdif=1:-1:0)
Example 2: Standard Framerate (Compatibility)
If you need to keep the original framerate (for example, converting 29.97i to 29.97p) to save file space or for specific device compatibility:
ffmpeg -i input.ts -vf bwdif=mode=send_frame:parity=auto:deint=all -c:v libx264 -crf 20 -c:a copy output.mp4(Alternative short syntax:
-vf bwdif=0:-1:0)