How to Blur Video Using FFmpeg boxblur

This article provides a practical guide on how to blur a video using the powerful boxblur filter in FFmpeg. You will learn the fundamental syntax of the filter, understand how its key parameters control the blur intensity, and see step-by-step command examples to apply the effect to your videos immediately.

Understanding the Boxblur Syntax

The boxblur filter in FFmpeg applies a box blur effect to the input video. The basic structure for the filter configuration is defined as follows:

boxblur=luma_radius:luma_power[:chroma_radius:chroma_power[:alpha_radius:alpha_power]]

Basic Blur Command

To apply a standard, moderate blur to an entire video, run the following FFmpeg command in your terminal:

ffmpeg -i input.mp4 -vf "boxblur=10:1" output.mp4

In this command, boxblur=10:1 sets the luma radius to 10 pixels and the power/passes to 1.

Creating a Heavy Blur

If you need a much stronger blur effect to completely obscure details, you can increase both the radius and the power parameters:

ffmpeg -i input.mp4 -vf "boxblur=25:5" output.mp4

Using a radius of 25 with 5 power passes creates a highly diffused, unrecognizable video.

Blurring a Specific Area of the Video

To blur only a specific portion of the video frame, you can combine the boxblur filter with the crop and overlay filters in a filter complex:

ffmpeg -i input.mp4 -filter_complex "[0:v]crop=300:300:100:100,boxblur=10:5[blurred];[0:v][blurred]overlay=100:100" output.mp4

This command performs the following steps: 1. crop=300:300:100:100: Isolates a 300x300 pixel square starting at the X=100, Y=100 coordinate. 2. boxblur=10:5: Applies a strong blur to this cropped area and labels the output stream as [blurred]. 3. overlay=100:100: Places the blurred square back onto the original video at the exact location from which it was cropped.