Configure FFmpeg Smartblur Radius Strength and Threshold
This article provides a quick overview and practical guide on how to
configure the luma radius, strength, and threshold parameters within the
FFmpeg smartblur filter. By understanding these three core
settings, you can effectively smooth out video noise and compression
artifacts while keeping important image edges and details sharp.
The smartblur filter in FFmpeg applies a selective blur
to your video. It targets flat areas of the image while preserving sharp
details (edges). To achieve this, it uses three primary luma
(brightness) parameters:
1. Luma Radius
(luma_radius or lr)
- Allowed Values:
0.1to5.0 - Purpose: This parameter determines the size of the blur matrix. A larger radius results in a wider, more spread-out blur effect, which is useful for smoothing larger areas of flat color or heavy noise. A smaller radius keeps the blur localized to finer details.
2. Luma Strength
(luma_strength or ls)
- Allowed Values:
-1.0to1.0 - Purpose: This controls the intensity of the blur.
- Positive values (0.0 to 1.0): Apply a blurring
effect. A value of
1.0represents maximum blur strength. - Negative values (-1.0 to 0.0): Apply a sharpening effect instead of a blur.
- Positive values (0.0 to 1.0): Apply a blurring
effect. A value of
3. Luma Threshold
(luma_threshold or lt)
- Allowed Values:
-30to30 - Purpose: This acts as an edge-detection sensitivity
gate.
- A value of
0means no edges are preserved, and the entire image is blurred. - Positive values: Prevent pixels with a difference greater than the threshold from being blurred. This preserves strong, high-contrast edges.
- Negative values: Increase the preservation of lower-contrast details, keeping even subtle transitions sharp.
- A value of
Filter Syntax and Examples
You can define these parameters in FFmpeg using either positional arguments or named key-value pairs. Named pairs are highly recommended for clarity.
Option A: Named Parameters (Recommended)
This method is explicit and prevents errors regarding parameter order:
ffmpeg -i input.mp4 -vf "smartblur=lr=3.0:ls=0.8:lt=-5" output.mp4Option B: Positional Parameters
If you prefer shorthand, pass the values in the exact order of
luma_radius:luma_strength:luma_threshold:
ffmpeg -i input.mp4 -vf "smartblur=3.0:0.8:-5" output.mp4Tips for Fine-Tuning
- For Noise Reduction: Start with a moderate radius
(
lr=2.0), a strong blur (ls=0.8), and a slightly negative threshold (lt=-2). This will clean up flat surfaces while keeping facial features and text sharp. - For Softening Skins: Use a lower radius
(
lr=1.0), a mild strength (ls=0.5), and a positive threshold (lt=3) to blend minor skin blemishes without losing the overall shape of the face.