How to Use the FFmpeg fieldorder Filter

This article explains how to use the fieldorder filter in FFmpeg to manage and convert the interlacing field order of your video files. You will learn the syntax, the available options for converting between top-field-first (tff) and bottom-field-first (bff) formats, and see practical command examples to correct playback issues in interlaced video.

Interlaced video displays frames using two alternate fields: the top field (even lines) and the bottom field (odd lines). The order in which these fields are displayed is critical. If a video is processed with the wrong field order, it will produce a shaky, stuttering effect during playback. The fieldorder filter resolves this by converting the video’s field order.

Syntax and Parameters

The basic syntax for the fieldorder filter is:

-vf "fieldorder=order"

The filter accepts one of two values for the order parameter: * tff: Sets the output to Top Field First. * bff: Sets the output to Bottom Field First.

Practical Examples

Converting Video to Top Field First (TFF)

If you have a bottom-field-first video and need to convert it to top-field-first, use the following command:

ffmpeg -i input.mp4 -vf "fieldorder=tff" output.mp4

Converting Video to Bottom Field First (BFF)

To convert a top-field-first video to bottom-field-first, run this command:

ffmpeg -i input.mp4 -vf "fieldorder=bff" output.mp4

How the Filter Works

When you apply the fieldorder filter, FFmpeg does not simply change the metadata flag. Instead, it shifts the video lines up or down by one line to preserve the correct temporal sync of the interlaced fields, and then updates the output container’s metadata to match the new order.

To ensure this filter works correctly, the input video must be recognized as interlaced by FFmpeg. If the input file metadata does not specify the field order, you must explicitly define it before applying the filter by using the setfield filter first:

ffmpeg -i input.mp4 -vf "setfield=bff,fieldorder=tff" output.mp4

In this example, FFmpeg first flags the input as bottom-field-first, and then converts the physical line layout to top-field-first.