Apply Bilateral Filter in FFmpeg for Noise Reduction

This article explains how to use the bilateral filter in FFmpeg to reduce image and video noise while preserving sharp edges. You will learn the syntax of the bilateral video filter, understand its key parameters (spatial and luma/chroma sigma), and see practical command-line examples to achieve clean, high-quality denoising results.

Understanding the Bilateral Filter

Unlike a standard Gaussian blur that smooths everything indiscriminately, a bilateral filter considers both spatial distance and pixel intensity differences. It only blurs pixels that are physically close and similar in color or brightness. This allows the filter to smooth out flat, noisy areas while leaving sharp borders and edges intact.

FFmpeg Bilateral Filter Syntax

The bilateral filter in FFmpeg is applied using the -vf (video filter) flag with the bilateral filter name. The basic syntax is:

ffmpeg -i input.mp4 -vf "bilateral=spatial_sigma=3.0:range_sigma=0.1" output.mp4

Key Parameters

To fine-tune the noise reduction, you can adjust three primary parameters:

Practical Command Examples

For mild, everyday noise reduction that retains fine details:

ffmpeg -i input.mp4 -vf "bilateral=spatial_sigma=2.0:range_sigma=0.05" output.mp4

For heavy noise reduction on highly pixelated or grainy footage:

ffmpeg -i input.mp4 -vf "bilateral=spatial_sigma=5.0:range_sigma=0.15" output.mp4

If you want to target only luma noise and leave color information untouched, you can reduce the chroma parameter:

ffmpeg -i input.mp4 -vf "bilateral=spatial_sigma=3.0:range_sigma=0.1:chroma_sigma=0.01" output.mp4