Adjust FFmpeg fspp Strength and Quantizer

This guide explains how to configure the Fast Simple Post-Processing (fspp) filter in FFmpeg to reduce compression artifacts. You will learn how to adjust the post-processing strength and customize the quantizer parameters using specific command-line arguments to optimize your video output quality.

The fspp filter is designed to remove blockiness and ringing artifacts from videos, particularly those encoded with lossy compression. It does this by applying a fast, simple consensus-based post-processing algorithm. To control how aggressively this filter behaves, you can adjust three primary parameters: quality, qp (quantization parameter), and strength.

The fspp Syntax

The basic syntax for the filter using named parameters is:

-vf "fspp=quality=value:qp=value:strength=value"

1. Adjusting the Post-Processing Strength

The strength parameter directly influences the filtering intensity. * Range: -15 to 32 (Default is 0). * Usage: Higher values result in stronger deblocking and smoothing, but setting it too high can blur fine details. Lower or negative values reduce the filtering effect.

Example Command: To apply a moderate strength of 5:

ffmpeg -i input.mp4 -vf "fspp=strength=5" output.mp4

2. Setting the Quantizer Parameter (QP)

By default, fspp automatically retrieves the quantization parameter (QP) from the source video’s frames to determine how much filtering is needed. However, you can manually override this by setting the qp parameter. * Range: 0 to 63. * Usage: A lower QP value tells the filter that the source video is of high quality, resulting in lighter filtering to preserve details. A higher QP value tells the filter that the source is heavily compressed, triggering stronger artifact reduction.

Example Command: To force a constant quantizer of 18:

ffmpeg -i input.mp4 -vf "fspp=qp=18" output.mp4

3. Adjusting Filter Quality

The quality parameter determines the number of iterations or directions the filter uses to process the video. * Range: 0 to 5 (Default is 4). * Usage: Higher values offer better visual results at the cost of slower processing speeds. Use 5 for the highest quality post-processing.

Example Command: To set the quality level to maximum:

ffmpeg -i input.mp4 -vf "fspp=quality=5" output.mp4

Combining All Parameters

For the best results, you can combine these parameters to tailor the deblocking process to your specific video.

To process a heavily pixelated video with maximum quality, a high quantizer override, and increased filter strength, use the following command:

ffmpeg -i input.mp4 -vf "fspp=quality=5:qp=24:strength=8" output.mp4