How to Sharpen Video with FFmpeg Unsharp Filter

This article provides a straightforward guide on how to use the FFmpeg unsharp filter to enhance and sharpen blurry or soft videos. You will learn the basic syntax of the filter, understand its key parameters (luma, chroma, matrix size, and amount), and see practical command-line examples to get immediate results.

Understanding the Unsharp Filter Syntax

The unsharp filter in FFmpeg works by applying a blur matrix to the video and subtracting it from the original image, which increases the contrast of the edges.

The basic syntax for the filter is:

-vf "unsharp=luma_msize_x:luma_msize_y:luma_amount:chroma_msize_x:chroma_msize_y:chroma_amount"

You can define parameters for both luma (brightness/details) and chroma (color). Usually, sharpening luma is enough to make a video look sharper without introducing color artifacts.

Key Parameters Explained

Practical FFmpeg Examples

1. Default Sharpening

If you use the filter without any parameters, FFmpeg applies a default luma sharpening effect of 5:5:1.0:5:5:0.0.

ffmpeg -i input.mp4 -vf "unsharp" -c:a copy output.mp4

2. Light Sharpening

To apply a subtle sharpening effect to your video, reduce the amount to around 0.5. This helps to avoid harsh edges and digital noise.

ffmpeg -i input.mp4 -vf "unsharp=5:5:0.5:0:0:0.0" -c:a copy output.mp4

(Note: Setting the chroma values to 0:0:0.0 disables sharpening on the color channels, which prevents color noise).

3. Strong Sharpening

For videos that are noticeably blurry, you can increase the matrix size to 7x7 and set the sharpening amount to 1.5.

ffmpeg -i input.mp4 -vf "unsharp=7:7:1.5:0:0:0.0" -c:a copy output.mp4

4. Sharpening Both Luma and Chroma

If you also want to sharpen the color edges of your video, you can apply the filter to the chroma channel.

ffmpeg -i input.mp4 -vf "unsharp=5:5:1.0:5:5:0.8" -c:a copy output.mp4

Tips for Best Results