How to Adjust CAS Sharpening Strength in FFmpeg
The Contrast Adaptive Sharpening (cas) filter in FFmpeg
provides a high-quality method to increase image clarity and detail
without introducing aggressive ringing artifacts. This guide explains
how to control the sharpening intensity using the filter's strength
parameter, outlines the supported value ranges, and provides practical
FFmpeg command examples for your video encoding workflow.
Understanding the Strength Parameter
The cas filter uses the strength option to
define the intensity of the sharpening algorithm.
- Range: The value is a floating-point number ranging
from
0.0to1.0. - Default: If omitted, the default value is
0.0, which provides the mildest sharpening effect. - Maximum: A value of
1.0applies the maximum level of adaptive sharpening.
Syntax and Command Examples
You apply the filter using the standard video filter flag
(-vf). The parameter can be declared explicitly as
strength=VALUE or implicitly as a positional argument.
Basic Usage (Explicit Parameter)
To apply a moderate sharpening strength of 0.5:
ffmpeg -i input.mp4 -vf "cas=strength=0.5" -c:a copy output.mp4Shorthand Syntax
You can omit the parameter name and supply the numeric value directly:
ffmpeg -i input.mp4 -vf "cas=0.6" -c:a copy output.mp4Recommended Strength Values
- Subtle Enhancement (
0.2–0.4): Ideal for clean 1080p or 4K sources that need slight definition recovery, particularly after downscaling or mild compression. - Balanced Sharpening (
0.5–0.7): Suitable for general video content where edges need noticeable enhancement without highlighting background noise. - Aggressive Sharpening (
0.8–1.0): Best used on soft or blurry inputs. Note that high values may amplify pre-existing film grain, digital sensor noise, or video compression artifacts.
Applying Strength to Specific Color Planes
By default, the cas filter sharpens all color planes (Y,
U, and V). If you want to sharpen only the luma (brightness) channel to
avoid amplifying color noise, specify the planes parameter
alongside strength:
ffmpeg -i input.mp4 -vf "cas=strength=0.5:planes=1" -c:a copy output.mp4In this command, planes=1 restricts the sharpening
strictly to the first plane (the luma channel in YUV formats).