How to Use the FFmpeg Weave Filter to Merge Fields

The weave filter in FFmpeg is designed to take field-based video input and combine alternating fields into full, interlaced video frames. This guide explains how the weave filter functions, breaks down its core configuration options, and provides practical command-line examples for common processing workflows, such as reconstructing interlaced video after field-level filtering or converting high-framerate progressive content into an interlaced output.

Understanding the Weave Filter

Video fields represent half of an interlaced frame, containing either only odd (top) or even (bottom) scanlines. The weave filter takes two consecutive input frames—treated as individual fields—and interleaves their scanlines to create a single output frame. As a result, using weave halves the frame count and the framerate of your video while doubling the vertical resolution.

Basic Syntax and Parameters

The basic syntax for applying the weave filter in an FFmpeg command is:

ffmpeg -i input.mp4 -vf "weave=first_field=top" output.mp4

The filter accepts a single primary parameter:

  • first_field (or f): Specifies which field comes first in temporal order.
    • top or t (Default): The first incoming slice of video is placed into the top field (lines 0, 2, 4...).
    • bottom or b: The first incoming slice of video is placed into the bottom field (lines 1, 3, 5...).

Practical Use Cases

1. Recombining Fields After Filtering

A standard workflow for processing interlaced video involves separating frames into individual fields using separatefields, applying a filter (such as a denoiser or scaler), and then reassembling the interlaced structure using weave:

ffmpeg -i interlaced_input.mov -vf "separatefields,yadif=0:-1:0,weave=first_field=top" -c:v libx264 output.mp4

In this pipeline:

  1. separatefields breaks each interlaced frame into two half-height frames, doubling the framerate.
  2. Intermediary processing is applied to each field independently.
  3. weave merges the pairs back into standard full-height frames with top-field-first (TFF) ordering.

2. Converting 60p/50p Progressive Video to 30i/25i Interlaced

If you have high-framerate progressive video (e.g., 50 fps or 59.94 fps) and need to deliver standard broadcast interlaced video (25 fps or 29.97 fps), you can use weave in combination with vertical decimation to merge temporal frames:

ffmpeg -i input_60p.mp4 -vf "interlace=scan=tff:lowpass=off" -c:v prores output_30i.mov

Alternatively, you can manually isolate lines and weave frames:

ffmpeg -i input_60p.mp4 -vf "select='not(mod(n,2))',weave=first_field=top" output_30i.mp4

3. Setting Bottom-Field First (BFF)

For formats that natively utilize bottom-field-first ordering (such as standard-definition DV), set the first_field option to bottom:

ffmpeg -i dv_fields.mov -vf "weave=first_field=bottom" -c:v rawvideo output_bff.mov

Verification

After generating the file, you can verify that the field order has been properly assigned by running ffprobe:

ffprobe -v error -select_streams v:0 -show_entries stream=field_order input.mp4

If the metadata does not reflect the output structure, explicitly set the field order flag using the setfield filter:

ffmpeg -i input.mp4 -vf "weave=first_field=top,setfield=tff" output.mp4