Convert Progressive to Interlaced with FFmpeg tinterlace
Converting progressive video to an interlaced format is a common
requirement for television broadcasting and compatibility with legacy
analog systems. This article provides a straightforward guide on how to
use FFmpeg’s tinterlace (temporal interlace) filter to
achieve this conversion using temporal decimation. You will learn the
correct command-line syntax, how the filter processes video frames, and
how to flags the output file correctly for interlaced playback.
Understanding Temporal Decimation with tinterlace
Temporal decimation in this context involves taking a high-frame-rate progressive video (such as 60p or 50p) and merging successive frames into alternating fields of a standard-frame-rate interlaced video (such as 30i or 25i).
For example, a 60 frames-per-second progressive video contains 60
full frames. By applying the tinterlace filter, FFmpeg
takes Frame 1 and extracts its odd lines to create Field 1, then takes
Frame 2 and extracts its even lines to create Field 2. These two fields
are combined into a single interlaced frame. This process halves the
overall frame rate (from 60fps to 30fps) while preserving the temporal
smoothness of the original 60fps capture.
The FFmpeg Command Syntax
To convert a progressive video to interlaced using temporal decimation, use the following basic command structure:
ffmpeg -i input_60p.mp4 -vf "tinterlace=mode=interlaceme" -flags +ilme+ildct output_30i.mp4Command Breakdown:
-i input_60p.mp4: Specifies your high-frame-rate progressive source video.-vf "tinterlace=mode=interlaceme": Applies the video filter.interlaceme(ormode=4) takes two consecutive progressive frames and merges them into one interlaced frame, resulting in a frame rate reduction by half.-flags +ilme+ildct: These flags are critical for the encoder.ilmeforces interlaced motion estimation.ildctforces interlaced discrete cosine transform (DCT) support. Without these flags, the encoder might compress the video as progressive, causing visual artifacts during playback.
Specifying Field Order (TFF vs. BFF)
Interlaced video relies on a specific field order: Top Field First
(TFF) or Bottom Field First (BFF). By default, tinterlace
outputs Top Field First.
If your target delivery format requires Bottom Field First (BFF), you must specify this in the filter arguments:
ffmpeg -i input_60p.mp4 -vf "tinterlace=mode=interlaceme:flags=blackman" -flags +ilme+ildct output_30i.mp4To explicitly set the field order output for downstream devices, you
can chain the fieldorder filter:
For Top Field First (TFF):
ffmpeg -i input_60p.mp4 -vf "tinterlace=mode=interlaceme,fieldorder=tff" -flags +ilme+ildct output_30i_tff.mp4For Bottom Field First (BFF):
ffmpeg -i input_60p.mp4 -vf "tinterlace=mode=interlaceme,fieldorder=bff" -flags +ilme+ildct output_30i_bff.mp4Verifying the Interlaced Output
After running the command, you can verify that the output video is
correctly recognized as interlaced by using ffprobe:
ffprobe -v error -select_streams v:0 -show_entries stream=field_order,r_frame_rate input_30i.mp4The output should display the halved frame rate (e.g.,
30/1 or 2997/100 instead of 60/1)
and the specified field order (tb for Top First, or
bt for Bottom First).