Configure FFmpeg Deblock Block Size and Thresholds

This article provides a direct guide on how to configure the block size, alpha, and beta thresholds using FFmpeg’s deblock filter. You will learn how these parameters interact to reduce blockiness in compressed videos, along with practical command-line examples to fine-tune your video outputs.

The deblock filter in FFmpeg is used to smooth out sharp, blocky artifacts caused by high video compression. It operates by analyzing pixel boundaries and applying a smoothing filter based on three main parameters: blocksize, alpha, and beta.

The Deblock Filter Syntax

The basic syntax for applying the deblock filter in an FFmpeg command is:

-vf "deblock=blocksize=VALUE:alpha=VALUE:beta=VALUE"

Parameter Breakdown

1. Block Size (blocksize)

2. Alpha Threshold (alpha)

3. Beta Threshold (beta)

Practical Command Examples

Standard Deblocking (Balanced)

To apply mild deblocking using a standard 8x8 grid with slightly elevated thresholds for general video improvement:

ffmpeg -i input.mp4 -vf "deblock=blocksize=8:alpha=0.15:beta=0.08" output.mp4

Strong Deblocking (For Highly Compressed Video)

For web videos with severe pixelation and visible square patterns, use a larger block size and aggressive thresholds:

ffmpeg -i input.mp4 -vf "deblock=blocksize=12:alpha=0.3:beta=0.15" output.mp4

Light Deblocking (Preserving High Detail)

To clean up minor artifacts in 1080p or 4K footage without losing sharpness:

ffmpeg -i input.mp4 -vf "deblock=blocksize=4:alpha=0.05:beta=0.02" output.mp4