Blur a video in ffmpeg

This script decribes how to easily blur part or all of a video with ffmpeg.

Install ffmpeg

On Windows and macOS : go to FFmpeg website and download the build
On Linux : sudo apt install ffmpeg in a terminal

Blur all the video

In [ ]:
cd /folder #Specify the directory where you file is
In [ ]:
ffmpeg -i video.mp4 -vf "boxblur=5:1" out.mp4 #put more than 5 to blur more

Blur part of the video

In [ ]:
ffmpeg -i video.mp4 \
-filter_complex "[0:v]crop=200:200:60:30,boxblur=5[fg];[0:v][fg]overlay=60:30[v]" \
-map "[v]" \
-map 0:a \
-c:v libx264 \
-c:a copy \
-movflags +faststart out.mp4

#this example creates a 200x200 pixels box that is 60 pixels to the right (x axis) and 30 pixels down (y axis) from the top left corner