Skip to content

Instantly share code, notes, and snippets.

@clayton
Created August 9, 2013 18:55
Show Gist options
  • Save clayton/6196167 to your computer and use it in GitHub Desktop.
Save clayton/6196167 to your computer and use it in GitHub Desktop.
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm
@75th
Copy link

75th commented Apr 10, 2020

I get the same error as @bfontaine.

@bryancasler
Copy link

@brookjordan's command did the trick

To be install ffmpeg as completely as possible without throwing errors, I eventually came to this:

brew install tesseract-lang && brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-fdk-aac --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rubberband --with-webp --with-zeromq --with-zimg --with-srt --with-libvmaf --with-libxml2 --with-game-music-emu --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-openssl@1.1 --with-rtmpdump --with-speex --with-two-lame --with-wavpack --with-xvid

That is missing only two extensions: --with-chromaprint --with-decklink

@onoakino
Copy link

onoakino commented May 8, 2020

@brookjordan's command did the trick

To be install ffmpeg as completely as possible without throwing errors, I eventually came to this:

brew install tesseract-lang && brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-fdk-aac --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rubberband --with-webp --with-zeromq --with-zimg --with-srt --with-libvmaf --with-libxml2 --with-game-music-emu --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-openssl@1.1 --with-rtmpdump --with-speex --with-two-lame --with-wavpack --with-xvid

That is missing only two extensions: --with-chromaprint --with-decklink

Getting the same error as @bfontaine and @75th. I tried to remove --with-chromaprint and --with-decklink and it still

musangs-MacBook-Pro:~ musang$ ffmpeg
dyld: Library not loaded: @rpath/libclang_rt.ubsan_osx_dynamic.dylib
Referenced from: /usr/local/opt/game-music-emu/lib/libgme.0.dylib
Reason: image not found
Abort trap: 6
musangs-MacBook-Pro:~ musang$

@badola
Copy link

badola commented May 15, 2020

I needed ffmpeg for merging videos of youtube-dl.
The below-mentioned command did the required installation.
brew install homebrew-ffmpeg/ffmpeg/ffmpeg

@victorwads
Copy link

I needed ffmpeg for merging videos of youtube-dl.
The below-mentioned command did the required installation.
brew install homebrew-ffmpeg/ffmpeg/ffmpeg

Work for me

@anhnguyenkim-agilityio
Copy link

anhnguyenkim-agilityio commented Aug 20, 2020

brew install homebrew-ffmpeg/ffmpeg/ffmpeg
Work for me now on macOS Mojave Version 10.14.5

@YuCJ
Copy link

YuCJ commented Aug 26, 2020

OS: macOS 10.15.6

# Remove old ffmpeg
brew uninstall ffmpeg

# Install third party repository (it's v4.3.1 currently)
# If you need any extra decoder for the mp4 file, use --with-* flag 
# Ref: https://trac.ffmpeg.org/wiki/CompilationGuide/macOS#ffmpegthroughHomebrew
#      https://github.com/homebrew-ffmpeg/homebrew-ffmpeg#installing-with-options
brew install homebrew-ffmpeg/ffmpeg/ffmpeg

# Check if there are VP8, VP9 encoders
ffmpeg -encoders
# ...
#  V..... libvpx               libvpx VP8 (codec vp8)
#  V..... libvpx-vp9           libvpx VP9 (codec vp9)
# ...

# Convert with VP9
ffmpeg -i input.mp4 -c:v libvpx-vp9 output.webm
# Convert with VP8
ffmpeg -i input.mp4 -c:v libvpx output.webm

@patdiddy
Copy link

when I entered brew install ffmpeg under 10.15.7, it worked for me

@jdpierce21
Copy link

brew install ffmpeg worked for me

@ExpandingShapes
Copy link

brew install ffmpeg
works just fine

@welch
Copy link

welch commented May 16, 2022

On a fresh MacOS Monterey install, a simple brew install ffmpeg got me all the following:

ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with Apple clang version 13.1.6 (clang-1316.0.21.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
libavutil 57. 17.100 / 57. 17.100
libavcodec 59. 18.100 / 59. 18.100
libavformat 59. 16.100 / 59. 16.100
libavdevice 59. 4.100 / 59. 4.100
libavfilter 8. 24.100 / 8. 24.100
libswscale 6. 4.100 / 6. 4.100
libswresample 4. 3.100 / 4. 3.100
libpostproc 56. 3.100 / 56. 3.100

@AtomicNess123
Copy link

I am getting

invalid option: --with-libass

I'm interested in libass. How to install it?
I'm on Mac.

@robflynn
Copy link

@AtomicNess123 When I installed ffmpeg recently via homebrew it came with libass already. Try just installing with brew install ffmpeg and then run ffmpeg by itself to see if: --enable-libass is int he output.

@AtomicNess123
Copy link

Thanks! I have the last version installed with brew: ffmpeg 5.1.2_1 is already installed and up-to-date.

ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with clang version 4.0.1 (tags/RELEASE_401/final)
  configuration: --prefix=/opt/concourse/worker/volumes/live/d5b9ea1c-8223-4ff6-7416-83e6b4cd6874/volume/ffmpeg_1587154914508/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol --cc=x86_64-apple-darwin13.4.0-clang --disable-doc --enable-avresample --enable-gmp --enable-hardcoded-tables --enable-libfreetype --enable-libvpx --enable-pthreads --enable-libopus --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-static --enable-version3 --enable-zlib --enable-libmp3lame --disable-nonfree --enable-gpl --enable-gnutls --disable-openssl --enable-libopenh264 --enable-libx264

It doesn't seem libass is in the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment