標準のバイナリでは、webp は有効になっていません。
Mac で ffmpeg ビルドするならば、以下のように、homebrew でできます。
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype \
--with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus \
--with-x265 --with-webp
すでに、ffmpeg が入っている場合は、brew reinstall
に置き換えてください。
以下のように、mp4 -> webp で animated な webpができます。
ffmpeg -i input.mp4 -vcodec libwebp -lossless 0 -qscale 75 -preset default \
-loop 0 -an -vsync 0 output.webp
なお、brew install ffmpeg
で使えるオプションはbrew info ffmpeg
で確認できます。
$ brew info ffmpeg
ffmpeg: stable 3.1.2 (bottled), HEAD
Play, record, convert, and stream audio and video
https://ffmpeg.org/
/usr/local/Cellar/ffmpeg/3.1.1 (236 files, 51.5M)
Poured from bottle on 2016-08-19 at 09:23:08
/usr/local/Cellar/ffmpeg/3.1.2 (241 files, 55.3M) *
Built from source on 2016-08-19 at 10:30:23 with: --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libvorbis --with-libvpx --with-opus --with-x265 --with-webp
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ffmpeg.rb
==> Dependencies
Build: pkg-config, texi2html, yasm
Recommended: x264, lame, xvid
Optional: faac, fontconfig, freetype, theora, libvorbis, libvpx, rtmpdump, opencore-amr, libass, openjpeg, snappy, speex, schroedinger, fdk-aac, opus, frei0r, libcaca, libbluray, libsoxr, libvidstab, x265, openssl, libssh, webp, zeromq, libbs2b, rubberband, zimg, xz, libebur128
==> Options
--with-faac
Build with faac support
--with-fdk-aac
Enable the Fraunhofer FDK AAC library
--with-ffplay
Enable FFplay media player
--with-fontconfig
Build with fontconfig support
--with-freetype
Build with freetype support
--with-frei0r
Build with frei0r support
--with-libass
Enable ASS/SSA subtitle format
--with-libbluray
Build with libbluray support
--with-libbs2b
Build with libbs2b support
--with-libcaca
Build with libcaca support
--with-libebur128
Enable using libebur128 for EBU R128 loudness measurement
--with-libsoxr
Enable the soxr resample library
--with-libssh
Enable SFTP protocol via libssh
--with-libvidstab
Enable vid.stab support for video stabilization
--with-libvorbis
Build with libvorbis support
--with-libvpx
Build with libvpx support
--with-opencore-amr
Enable Opencore AMR NR/WB audio format
--with-openh264
Enable OpenH264 library
--with-openjpeg
Enable JPEG 2000 image format
--with-openssl
Enable SSL support
--with-opus
Build with opus support
--with-rtmpdump
Enable RTMP protocol
--with-rubberband
Enable rubberband library
--with-schroedinger
Enable Dirac video format
--with-snappy
Enable Snappy library
--with-speex
Build with speex support
--with-theora
Build with theora support
--with-tools
Enable additional FFmpeg tools
--with-webp
Enable using libwebp to encode WEBP images
--with-x265
Enable x265 encoder
--with-xz
Enable decoding of LZMA-compressed TIFF files
--with-zeromq
Enable using libzeromq to receive commands sent through a libzeromq client
--with-zimg
Enable z.lib zimg library
--without-lame
Disable MP3 encoder
--without-qtkit
Disable deprecated QuickTime framework
--without-x264
Disable H.264 encoder
--without-xvid
Disable Xvid MPEG-4 video encoder
--HEAD
Install HEAD version
==> Caveats
The native FFmpeg AAC encoder has been stable since FFmpeg 3.0. If you
were using libvo-aacenc or libaacplus, both of which have been dropped in
FFmpeg 3.0, please consider switching to the native encoder (-c:a aac),
fdk-aac (-c:a libfdk_aac, ffmpeg needs to be installed with the
--with-fdk-aac option), or faac (-c:a libfaac, ffmpeg needs to be
installed with the --with-faac option).
See the announcement
https://ffmpeg.org/index.html#removing_external_aac_encoders for details,
and https://trac.ffmpeg.org/wiki/Encode/AAC on best practices of encoding
AAC with FFmpeg.