Search code examples
ffmpeg

ffmpeg: how to add pixellate effect?


I need to blur some uploaded videos and encoded them. Infact by blur, it means pixellate them so "big squares" appear and blur it.

Any idea on how I can do that ? (ffmpeg would be great, by any command line windows tool should be ok)

Thanks.


Solution

  • FFmpeg can support the frei0r filters which includes pixeliz0r

    original pixeliz0r

    Example:

    ffmpeg -i input -vf "frei0r=filter_name=pixeliz0r:filter_params=0.02|0.02" output
    

    The two pixeliz0r filter_params parameters are:

    • BlockSizeX: horizontal size of one "pixel"
    • BlockSizeY: vertical size of one "pixel"

    Larger values will create larger blocks.

    Where to get ffmpeg with frei0r support

    • Windows users can get the "full build" from gyan.dev.

    • Linux users can download or compile:

      • Download ffmpeg with frei0r support at johnvansickle.com.
      • Or compile ffmpeg by installing whatever package provides frei0r.h (such as frei0r-plugins-dev in Ubuntu or frei0r-devel in CentOS) and then add --enable-frei0r to your ffmpeg configure. See FFmpeg Wiki: Compile Guides.
    • macOS users can use Homebrew. You may need the --with-frei0r option.

    More info