Skip to content

Instantly share code, notes, and snippets.

@dmk1111
Last active March 4, 2022 08:12
Show Gist options
  • Select an option

  • Save dmk1111/a92a2e8ec4187d921e5c4bb6d5cee7ee to your computer and use it in GitHub Desktop.

Select an option

Save dmk1111/a92a2e8ec4187d921e5c4bb6d5cee7ee to your computer and use it in GitHub Desktop.
Install ffmpeg with all options on (Mac OS)

Originally taken from https://gist.github.com/Piasy/b5dfd5c048eb69d1b91719988c0325d8?permalink_comment_id=3314991#gistcomment-3314991

Only way I managed to install it was to compile it myself. Any other way I would only keep getting a recursive dependency error, with ChromaPrint requiring FFmpeg and FFmpeg requiring ChromaPrint.

# start clean. make sure you have xcode installed and all the other basics such as brew.
brew uninstall --force ffmpeg chromaprint amiaopensource/amiaos/decklinksdk

# installs ffmpeg vanilla as dependency
brew install chromaprint amiaopensource/amiaos/decklinksdk

# let's neuter that shit
brew unlink ffmpeg

# install dependencies to cook our own
brew install automake fdk-aac git lame libass libtool libvorbis libvpx opus \
sdl shtool texi2html theora wget x264 x265 xvid nasm
# and we're done brewing. Lay off the beer for now.

# clone head
# if you ever want to update or customize FFmpeg at any point 
# just delete the binary (/usr/local/bin/ffmpeg in this case)
# and start again from this step.
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg

# at this point, ChromaPrint has to be installed, else this step will fail.
# sample compilation command. Customize this to your needs
# the flags are different from the brew version LDO. RTFM. To see the options, run:
# ./configure --help
# Info MacOS here https://trac.ffmpeg.org/wiki/CompilationGuide/macOS
# info Debian family here https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
# info RHEL family here https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# I have no idea if this will work in windows. 
./configure  --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libopus --enable-libxvid --enable-chromaprint --enable-libopenjpeg --enable-libaom --extra-ldflags=-L/usr/local/lib --samples=fate-suite/


# the actual install once you're done configuring
make && make install

# ffmpeg should install to /usr/local/bin/ffmpeg. Test this out
which ffmpeg
ffmpeg -version

example output

% which ffmpeg

/usr/local/bin/ffmpeg


% ffmpeg -version

ffmpeg version N-97866-g38490cbeb3 Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 11.0.3 (clang-1103.0.32.59)
configuration: --prefix=/usr/local --enable-chromaprint --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-gmp --enable-version3 --enable-libwebp --enable-libopenjpeg --extra-ldflags=-L/usr/local/lib
libavutil      56. 46.100 / 56. 46.100
libavcodec     58. 86.101 / 58. 86.101
libavformat    58. 43.100 / 58. 43.100
libavdevice    58.  9.103 / 58.  9.103
libavfilter     7. 82.100 /  7. 82.100
libswscale      5.  6.101 /  5.  6.101
libswresample   3.  6.100 /  3.  6.100
libpostproc    55.  6.100 / 55.  6.10

Edit: Added AV1 and VP9 support

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