Use FFmpeg pp Filter for Deblocking and Deringing

This article explains how to use the FFmpeg pp (Postprocessing) filter to apply legacy MPlayer deblocking and deringing algorithms to your videos. You will learn the core syntax, key sub-filter options, and practical command-line examples to clean up compression artifacts and improve the visual quality of low-bitrate or legacy video files.

Understanding the pp Filter Syntax

The pp filter hooks into the legacy MPlayer postprocessing library (libpostproc). To use it, you pass specific sub-filters as arguments, separated by slashes (/).

The primary sub-filters for deblocking and deringing are: * hb: Horizontal deblocking (applied to luminance and chroma by default). * vb: Vertical deblocking. * dr: Deringing (reduces ringing artifacts/halos around sharp edges).

You can also append modifiers to these options to target specific color channels, such as :a for automatic decision or :c to filter chroma channels.

Basic Deblocking and Deringing Command

To apply standard horizontal deblocking, vertical deblocking, and deringing to a video, use the following FFmpeg command:

ffmpeg -i input.mp4 -vf "pp=hb/vb/dr" output.mp4

In this command: * -vf "pp=hb/vb/dr" chain-links the three postprocessing filters together. * FFmpeg will analyze the video frames and smooth out block boundary transitions while suppressing ringing noise around high-contrast edges.

Using the Default Postprocessing Preset

If you want a quick, pre-configured setup without specifying individual sub-filters, you can use the default preset alias de. The de option is a combination of horizontal and vertical deblocking, deringing, and automatic luminance filtering.

ffmpeg -i input.mp4 -vf "pp=de" output.mp4

Advanced Filtering with Intensity Thresholds

The pp filter allows you to fine-tune the strength of the deblocking and deringing processes by passing threshold parameters.

For example, to specify custom threshold values for horizontal and vertical deblocking, format the filter like this:

ffmpeg -i input.mp4 -vf "pp=hb:f/vb:f/dr" output.mp4

Using the :f modifier forces the filter to apply full-strength processing, which is useful for highly pixelated, low-quality legacy videos where standard automatic thresholds fail to detect block boundaries.