#mac #magick #mogrify #imagemagick #webp #gif #mp4
macOS 批量将 webp 转换为 gif, gif 转 mp4
1. 安装 homebrew
2. 安装
3.
例如
得到路径
4.
5. 使用路径 webp 转 gif
6. 安装
7. gif 转 mp4
macOS 批量将 webp 转换为 gif, gif 转 mp4
1. 安装 homebrew
2. 安装
brew install imagemagick3.
brew info imagemagick 查看 路径例如
==> imagemagick: stable 7.1.1-29 (bottled), HEAD
Tools and libraries to manipulate images in many formats
https://imagemagick.org/index.php
/usr/local/Cellar/imagemagick/7.1.1-29_1 (809 files, 29MB) *得到路径
/usr/local/Cellar/imagemagick/7.1.1-29_14.
cd /tmp/webp 此为你存放 webp 文件的目录5. 使用路径 webp 转 gif
/usr/local/Cellar/bin/imagemagick/7.1.1-29_1/mogrify -format gif *.webp6. 安装
brew install ffmpeg7. gif 转 mp4
for file in *.gif; do ffmpeg -i "$file" -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "${file%.gif}.mp4"; done