How to Use the FFmpeg uspp Filter
This article provides a straightforward guide on how to use the
uspp (Ultra Simple Post Processing) filter in FFmpeg to
reduce compression artifacts and improve video quality. You will learn
the basic syntax, key parameters, and practical command-line examples to
implement this filter effectively in your video encoding projects.
Understanding the uspp Filter
The uspp filter, which stands for Ultra Simple Post
Processing, is a video filter in FFmpeg designed to reduce blocking and
ringing artifacts in heavily compressed videos. It works by applying a
form of motion-compensated deblocking using the Snow codec’s internal
post-processing code. While it is highly effective at cleaning up
low-quality source videos, it is computationally expensive and will
significantly slow down encoding speeds.
Syntax and Key Parameters
The basic syntax for applying the uspp filter in an
FFmpeg command is:
-vf uspp=parameter1=value1:parameter2=value2
The filter accepts two main parameters: * quality:
Sets the post-processing quality. The range is from 0 to
8. A higher number results in better artifact reduction but
requires significantly more processing power. The default value is
3. * qp: Forces a constant quantization
parameter (QP). If this is not specified, the filter will use the QP
directly from the source video.
Practical Examples
Basic Usage with Default Settings
To apply the uspp filter with its default settings to a
video, use the following command:
ffmpeg -i input.mp4 -vf uspp output.mp4Enhancing Quality for Heavily Compressed Videos
To increase the filter’s effectiveness on highly pixelated or blocky
videos, you can increase the quality parameter (for example, to
6):
ffmpeg -i input.mp4 -vf uspp=quality=6 output.mp4Combining uspp with Other Filters
In restoration workflows, you may want to scale the video or adjust
contrast alongside deblocking. You can chain the uspp
filter with other video filters using a comma:
ffmpeg -i input.mp4 -vf "scale=1280:-1,uspp=quality=4" output.mp4When to Use uspp
Because uspp is highly resource-intensive, it is best
reserved for archiving or restoring older, highly compressed,
low-resolution videos (such as early mobile phone footage or low-bitrate
web videos). For modern high-definition content, alternative filters or
encoding at a higher bitrate are generally preferred.