[FFmpeg-user] Using ffmpeg to blur moving objects

Boris T boris.t.richard at gmail.com
Mon Oct 31 03:55:26 EET 2016


Hello,

I'm using ffmpeg to blur moving objects in videos with a command similar to
this one:

ffmpeg -i "input.mp4" -filter_complex_script "myscript.txt" -map
"[step0_overlay]" -f MP4 -c:v libx264 -x264opts
keyint=15:min-keyint=15:scenecut=-1  -movflags faststart -y "output.mp4"

myscript.txt contents:

[0:v]crop=160.00:160.00:94.40:96.00,boxblur=luma_radius=min(10\,min(w\,h)/2):chroma_radius=min(10\,min(cw\,ch)/2)[step0];[0:v][step0]overlay=94.400:96.00:repeatlast=0:enable='between(t,0.073,7.55839409433962)'[step0_overlay];

This does the job fine, but since I'm blurring moving objects, I end up
with multiple crop and overlay filters enabled for fractions of seconds.
For a 2-minute video with a constantly moving object I can end up with 2000
of these crop-overlay steps, and the more overlay steps I have, the slower
the processing gets (less than a frame per second) Is there a better,
faster approach to this problem?

I've tried using sendcmd to modify and move the blurred overlay on the fly
(and presumably avoid having to keep multiple overlays in the filter graph)
however I ended up with a blurred box inside the original blurred box.

Any input on this problem would be greatly appreciated!

Boris


More information about the ffmpeg-user mailing list