Remove Telecine in FFmpeg with Fieldmatch and Decimate

This guide explains how to perform inverse telecine (IVTC) in FFmpeg using the fieldmatch and decimate filters. You will learn how these filters work together to reconstruct original progressive frames from telecined video and how to apply the correct FFmpeg command to achieve clean, judder-free 24fps output.

Understanding the IVTC Process

Telecine is a process used to convert 24 frames-per-second (fps) film into 30fps (or 29.97fps) video for television broadcast by distributing film frames across alternating video fields. To reverse this and restore the original progressive film frames, you must perform Inverse Telecine (IVTC) using two filters in a specific order:

  1. fieldmatch: Reconstructs the original progressive frames by matching complementary interlaced fields.
  2. decimate: Identifies and drops the duplicate frames resulting from the field matching process, reducing the frame rate back to the original 23.976 fps.

The Basic FFmpeg Command

To apply both filters, chain them together in the video filter (-vf) argument. The standard command for removing telecine is:

ffmpeg -i input.mp4 -vf "fieldmatch,decimate" -c:v libx264 -crf 20 -c:a copy output.mp4

How the Filters Work Together

  • fieldmatch (Step 1): This filter analyzes the stream and matches fields to recreate progressive frames. By default, it assumes the standard telecine pattern. It does not change the frame rate; it merely combines fields so that the frames are no longer interlaced, though some duplicate frames will now exist.
  • decimate (Step 2): Once fieldmatch has combined the fields, decimate looks at groups of frames (by default, blocks of 5 frames) and removes the one frame that is a duplicate. This drops the frame rate from 29.97 fps to the standard film rate of 23.976 fps.

Key Parameters and Fine-Tuning

While the default settings work for most standard telecined content, you can adjust parameters for difficult sources:

  • Handling Audio Sync: IVTC changes the frame rate, which can occasionally cause audio synchronization issues. Adding the -vsync cfr flag forces a constant frame rate output to keep audio aligned:

    ffmpeg -i input.mp4 -vf "fieldmatch,decimate" -vsync cfr -c:v libx264 -crf 20 output.mp4
  • Adjusting Decimate Cycle: By default, decimate operates on a cycle=5 pattern (dropping 1 frame out of 5). If you are dealing with non-standard conversions, you can manually define the cycle:

    ffmpeg -i input.mp4 -vf "fieldmatch,decimate=cycle=5" -c:v libx264 output.mp4