Convert all PNGs in a folder to WEBP with FFmpeg

FFmpeg is an awesome tool that can convert not only videos but also audio and images.

On Linux and Mac, run it like this in the folder where you want the conversion to run:

for i in *.png; do ffmpeg -y -i "$i" -c:v libwebp "${i%.*}.webp"; done

On Windows:

FOR /F "tokens=*" %G IN ('dir /b *.png') DO ffmpeg -y -i "%G" -c:v libwebp "%~nG.webp"


Leave a Comment

Your email address will not be published. Required fields are marked *