Can someone show me how to enhance the example found here: FFmpeg - Apply blur over face
To do the following:
- Use an input alpha mask PNG instead of a declared rectangular region
- both blur and greyscale the masked region
This is another example - showing how to use an alpha mask file Crop triangular area with FFMPEG
Thanks
Answer
Here's a method using alphamerge
, hue
, boxblur
, and overlay
.
Original input, filtered output, mask image.
Example:
ffmpeg -i input -loop 1 -i mask.png -filter_complex \
"[0:v][1:v]alphamerge,hue=s=0,boxblur=5[fg]; \
[0:v][fg]overlay[v]" -map "[v]" -map 0:a -c:a copy output
The mask should be the same size as the input. If it isn't you could use
scale
orscale2ref
to resize it.The audio is stream copied to avoid unnecessary encoding.
No comments:
Post a Comment