How to Use the FFmpeg sabr Filter

This guide demonstrates how to apply the Shape Adaptive Bilateral (sabr) filter in FFmpeg to achieve high-quality video denoising and smoothing. You will learn the filter’s syntax, its core parameters for controlling luma and chroma, and practical command-line examples to enhance your video processing pipelines while preserving sharp image edges.

What is the sabr Filter?

The sabr filter is a Shape Adaptive Bilateral Filter used for image and video denoising. Unlike standard bilateral filters, which use fixed-size circular or square windows to blur noise while preserving edges, the shape-adaptive bilateral filter adapts its shape to the local features of the image. This prevents the “halo” artifacts commonly associated with aggressive bilateral filtering, making it highly effective for smoothing flat areas while keeping outlines and fine details incredibly sharp.

Syntax and Key Parameters

To use the sabr filter, you apply it to the video filter (-vf) graph. The filter accepts four primary parameters to control the spatial and range (color intensity) sensitivity for both the luma (brightness) and chroma (color) channels:

Practical FFmpeg Examples

1. Basic Application (Default Settings)

If you want to apply the filter using its default settings, run the following command:

ffmpeg -i input.mp4 -vf "sabr" output.mp4

This applies a mild, edge-preserving denoise to your video using the default spatial sigma of 1.0 and range sigma of 0.08 for both luma and chroma.

2. Strong Denoising for Flat Areas

To remove heavy noise or compression artifacts from a video with large, flat color areas (such as animation or sky backdrops), you can increase both the spatial and range parameters:

ffmpeg -i input.mp4 -vf "sabr=lsp=3.0:lr=0.15:csp=2.0:cr=0.1" output.mp4

3. Preserving Fine Details (Conservative Denoising)

To clean up low-light noise in high-detail footage without making the video look plastic or overly smoothed, lower the range sigmas:

ffmpeg -i input.mp4 -vf "sabr=lsp=1.5:lr=0.04:csp=1.5:cr=0.04" output.mp4