If you do not want to install the frei0r plugin for this, there is an alternative way.
dimensions=$(ffprobe -v error -show_entries stream=width,height -of "csv=p=0:s=\:" input | head -1) ffmpeg -i input -filter_complex \ "[0:v] scale='iw/15:-1', scale='$dimensions:flags=neighbor'" output
This reduces the size of the input file (in this example, by 15), and then reduces it to its original size. flags=neighbor tells ffmpeg to use the nearest neighbor scaling algorithm, which results in a pixelated effect. You can resize the block by changing the number 15.
The first line is necessary to determine the input source size and scale directly to it, otherwise reducing or increasing it can lead to rounding errors that will slightly change the size of the output.
source share