16
19

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Homebrew を使ってwebp対応のffmpegをインストール

Posted at

標準のバイナリでは、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.
16
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
19

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?