How to Use FFmpeg fftfilt to Remove Film Grid Noise

Scanning physical film often introduces unwanted high-frequency grid noise, scan lines, or Moiré patterns into the digital transfer. This article provides a direct, step-by-step guide on how to construct an FFmpeg command using the Fast Fourier Transform filter (fftfilt) to isolate and eliminate these specific high-frequency periodic patterns, restoring the visual clarity of your digitized film.

The FFmpeg Command

To eliminate high-frequency grid noise, you need to apply a low-pass filter in the frequency domain. This allows low-frequency visual data (the actual film content) to pass through while blocking the high-frequency repetitive grid patterns.

Run the following command in your terminal:

ffmpeg -i input.mp4 -vf "fftfilt=weight_Y='if(lte(sqrt(pow(min(X,W-X),2)+pow(min(Y,H-Y),2)),30),1,0)'" -c:a copy output.mp4

How the Command Works

The fftfilt filter processes the video in the frequency domain rather than the spatial domain. Here is a breakdown of how the mathematical expression target the grid noise:

Fine-Tuning the Filter

Because every film scan is different, you may need to adjust the threshold value (set to 30 in the example above) to achieve the best balance between noise reduction and image sharpness:

Applying to Color Channels (Optional)

If the grid noise also appears as color banding or chromatic aberrations, you can apply the same filter to the chroma channels (U and V) by adding weight_U and weight_V parameters to the filter chain:

ffmpeg -i input.mp4 -vf "fftfilt=weight_Y='if(lte(sqrt(pow(min(X,W-X),2)+pow(min(Y,H-Y),2)),30),1,0)':weight_U='if(lte(sqrt(pow(min(X,W-X),2)+pow(min(Y,H-Y),2)),30),1,0)':weight_V='if(lte(sqrt(pow(min(X,W-X),2)+pow(min(Y,H-Y),2)),30),1,0)'" -c:a copy output.mp4