Adjust FFmpeg Unsharp Filter Luma and Chroma Settings

This article provides a straightforward guide on how to configure the luma (brightness) and chroma (color) matrix settings within FFmpeg’s unsharp filter. You will learn the syntax structure, the meaning of each matrix parameter, and how to apply practical command-line examples to sharpen or blur these components independently.

The Unsharp Filter Syntax

The unsharp filter in FFmpeg uses a grid-based matrix to apply sharpening or blurring to an image. The filter separates these effects into luma (y) and chroma (u/v) channels.

The full syntax for the filter is:

unsharp=luma_msize_x:luma_msize_y:luma_amount:chroma_msize_x:chroma_msize_y:chroma_amount

You can also use the abbreviated parameter names:

unsharp=lx:ly:la:cx:cy:ca

Parameter Breakdown


Practical Examples

1. Sharpening Luma Only (Standard Video Sharpening)

Human eyes are highly sensitive to brightness details (luma) and less sensitive to color details (chroma). To sharpen a video without introducing color artifacts, apply the filter only to the luma channel and set the chroma amount to 0.0.

ffmpeg -i input.mp4 -vf "unsharp=5:5:1.0:5:5:0.0" output.mp4

2. Sharpening Both Luma and Chroma

If your video is noticeably soft or blurry, you can apply sharpening to both channels.

ffmpeg -i input.mp4 -vf "unsharp=7:7:1.5:5:5:0.8" output.mp4

3. Blurring Luma and Chroma (Denoising/Softening)

By using negative values, you can turn the unsharp filter into a fast blur filter. This is useful for reducing high-frequency noise.

ffmpeg -i input.mp4 -vf "unsharp=5:5:-1.0:5:5:-1.0" output.mp4

4. Using Named Parameters

If you do not want to define every single positional argument, you can specify only the parameters you want to change using named arguments:

ffmpeg -i input.mp4 -vf "unsharp=la=1.8:ca=0.5" output.mp4