FFmpeg Reverse Telecine with Custom Thresholds
This article explains how to perform a reverse telecine (inverse
telecine or IVTC) in FFmpeg using custom frame thresholds. You will
learn how to use both the modern, highly configurable
fieldmatch and decimate filter chain—which
offers precise threshold controls—as well as the legacy
pullup filter to successfully restore 24fps progressive
video from a 30fps telecined source.
Method 1: The Recommended Approach (fieldmatch and decimate)
The most precise way to perform a reverse telecine with custom
thresholds in FFmpeg is using the fieldmatch filter
combined with the decimate filter. This combination allows
you to explicitly define how aggressively FFmpeg matches fields and
detects combed (interlaced) frames.
The Command
ffmpeg -i input.mp4 -vf "fieldmatch=mthresh=3:cthresh=9:combmatch=sc,decimate" -c:a copy output.mp4Parameter Breakdown
fieldmatch: Reconstructs the progressive frames by matching matching fields.mthresh=3(Match Threshold): Controls the sensitivity of the field matching. It defines the maximum difference allowed between two fields to consider them a match. Lower values make the matching stricter; higher values make it more tolerant of noise. The default is 3.cthresh=9(Chroma Threshold): Sets the threshold for comb (interlacing) detection. It determines how different a pixel must be from its neighbors to be flagged as “combed.” Lower values make comb detection more sensitive (catching more interlacing artifacts), while higher values prevent false positives in high-detail areas. The default is 9.combmatch=sc: Enables spatial-correlation-based comb detection, which is highly effective at distinguishing actual interlacing from high-frequency vertical detail.
decimate: Drops the duplicate frame resulting from the 3:2 pulldown pattern, outputting the clean 23.976 fps (or 24 fps) video.
Method 2: Using the Classic Pullup Filter
The legacy pullup filter is a heuristic-based filter
designed to handle mixed-content or poorly telecined sources. While it
does not feature direct pixel-difference threshold parameters like
fieldmatch, you can customize its thresholds using border
exclusions and strictness settings.
The Command
ffmpeg -i input.mp4 -vf "pullup=jl=8:jr=8:jt=8:jb=8:sb=1" -r 24000/1001 -c:a copy output.mp4Parameter Breakdown
jl,jr,jt,jb(Junk Left/Right/Top/Bottom): These parameters tell the filter to ignore a specific number of pixels on the edges of the frame (default is 8). Analog video often has head-switching noise or black borders at the edges that distort frame-matching thresholds. Excluding these areas prevents the filter from making incorrect matching decisions.sb(Strict Breaks): Setting this to1(strict) or0(normal) alters the decision-making threshold at scene cuts. If you experience frames jumping or stuttering immediately after a scene change, setsb=1to force the filter to avoid blending fields across the cut.-r 24000/1001: Unlikedecimate, thepullupfilter does not automatically drop the frame rate, so you must explicitly set the output frame rate to NTSC progressive (23.976 fps) using this flag.
How to Adjust Thresholds for Your Source Video
If your output video still shows interlacing artifacts or plays back with stuttering, adjust the thresholds based on these symptoms:
- If you see horizontal combing lines (interlacing):
Decrease the
cthreshvalue infieldmatch(e.g., to6or7). This forces FFmpeg to be more aggressive in identifying and deinterlacing unmatched fields. - If the video stutters/jerks: Increase the
mthreshvalue (e.g., to5or6). This allows the filter to match fields even if there is slight noise or compression artifacts in the source file.