Sharpen Blurry Video Using FFmpeg Unsharp Filter

This guide provides a straightforward tutorial on how to fix blurry videos using FFmpeg’s built-in unsharp video filter. You will learn the exact command-line syntax, understand how the filter’s parameters work, and see practical examples to restore clarity and detail to your video files.

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

The Unsharp Filter Syntax

The basic structure of the unsharp filter parameter is:

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

These parameters are divided into two main categories: Luma (which controls the brightness and detail/edges) and Chroma (which controls the color).

Practical Command Examples

To apply the filter, use the -vf (video filter) flag in your FFmpeg command.

1. Default Sharpening

If you want to apply a moderate, safe level of sharpening without manually tweaking numbers, you can run the filter with its default settings:

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

The default settings are 5:5:1.0:5:5:0.0, which sharpens the luma (details) by a factor of 1.0 while leaving the chroma (colors) untouched.

2. Strong Sharpening for Very Blurry Videos

If your video is noticeably blurry, you can increase both the matrix size and the sharpening amount for the luma:

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

This uses a larger 7x7 matrix and sets the sharpening intensity to the maximum value of 1.5.

3. Sharpening Both Detail and Color

In some cases, sharpening the colors (chroma) along with the details (luma) can improve the video’s appearance. Use the following command to apply moderate sharpening to both:

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

This sharpens the details by 0.8 and the colors by 0.4.

Tips for Best Results