How to Use the FFmpeg bwdif Filter

This guide provides a quick and practical overview of how to use the bwdif (Bob Weaver Deinterlacing Filter) in FFmpeg. You will learn what the filter does, how its primary parameters work, and how to apply it to your videos using straightforward command-line examples to achieve high-quality deinterlacing.

What is bwdif?

The bwdif filter is a motion-adaptive deinterlacing algorithm based on the “Bob Weaver” method. It is highly regarded in the FFmpeg community because it often produces sharper results with fewer visual artifacts than older filters like yadif.

Basic Syntax

To use bwdif in FFmpeg, you apply it via the video filter flag (-vf). The basic syntax is:

-vf "bwdif=mode=value:parity=value:deint=value"

Key Parameters

Practical Examples

Example 1: Standard Deinterlacing (Double Frame Rate)

By default, bwdif uses mode=1, which outputs a progressive frame for every field (bobbing). This is ideal for fast-moving content like sports because it preserves the fluid motion of the original interlaced video.

ffmpeg -i input.mp4 -vf "bwdif" output.mp4

Example 2: Keep Original Frame Rate

If you want to keep the original frame rate (e.g., converting 29.97i to 29.97p), set the mode to 0.

ffmpeg -i input.mp4 -vf "bwdif=mode=0" output.mp4

Example 3: Specifying Field Order Manually

If automatic detection fails and your output video has a jittery motion, you can manually specify the field dominance. For Top Field First (TFF) files, use:

ffmpeg -i input.mp4 -vf "bwdif=mode=1:parity=0" output.mp4

For Bottom Field First (BFF) files, use:

ffmpeg -i input.mp4 -vf "bwdif=mode=1:parity=1" output.mp4