home ~ socials ~ projects ~ rss

Apply Multiple Blur Areas To A Video With ffmpeg

September 2023

This is a command that applies three different blur boxes to a video

CMD="[0:v]copy[base];";

CMD="$CMD[0:v]crop=94:23:0:0,boxblur=4[tmp];"
CMD="$CMD[base][tmp]overlay=113:4[base];"

CMD="$CMD[0:v]crop=72:52:6:47,boxblur=4[tmp];"
CMD="$CMD[base][tmp]overlay=6:47[base];"

CMD="$CMD[0:v]crop=130:18:77:48,boxblur=4[tmp];"
CMD="$CMD[base][tmp]overlay=77:48[base];"

ffmpeg -i "in.mp4" \
-filter_complex "$CMD" \
-map "[base]" \
-y out.mp4

Notes

  • The blurbox will break if the cropbox is too close to the edge
  • The idea here is that you could add as many blurs as you'd like via a script or whatnot via a loop
end of line
Share link:
https://www.alanwsmith.com/en/2v/sx/wd/i6/?apply-multiple-blur-areas-to-a-video-with-ffmpeg