Skip to content

Instantly share code, notes, and snippets.

@blackrobot
Last active November 22, 2019 01:00
Show Gist options
  • Save blackrobot/5ff60ea171ecf4a2e3050717260b035d to your computer and use it in GitHub Desktop.
Save blackrobot/5ff60ea171ecf4a2e3050717260b035d to your computer and use it in GitHub Desktop.
class Chromaprint < Formula
# Revert chromaprint changes to prevent ffmpeg circular dependency
# https://github.com/Homebrew/homebrew-core/pull/46684
# https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/13
desc "Core component of the AcoustID project (Audio fingerprinting)"
homepage "https://acoustid.org/chromaprint"
url "https://github.com/acoustid/chromaprint/releases/download/v1.4.3/chromaprint-1.4.3.tar.gz"
sha256 "ea18608b76fb88e0203b7d3e1833fb125ce9bb61efe22c6e169a50c52c457f82"
bottle do
cellar :any
sha256 "aec3832bf6ffc46535afa1bf6a429d267a72a49ce7fe82e558bd2637b1a97aa6" => :catalina
sha256 "88b395f32a669162b2d270c9f38711fe884aabacc7c7ce9062dbf420d5445a21" => :mojave
sha256 "3d0ae4279d4d3fa0fad24c434e82032384256ed1613e89e7b601e1f02ceaa596" => :high_sierra
sha256 "fc91e7116562484496de75f3e3e0a7a61771b9826b6f3a4497af411df2683290" => :sierra
sha256 "799c9c907b020aed48763162b996a672d42b3b8dde5a53381e28818ccd0981dc" => :el_capitan
end
depends_on "cmake" => :build
def install
system "cmake", ".", *std_cmake_args
system "make", "install"
end
end

Install ffmpeg on macOS with non-free extensions

This tap offers the non-free options:

https://github.com/homebrew-ffmpeg/homebrew-ffmpeg

brew tap homebrew-ffmpeg/ffmpeg
# (optional) lists the available install options
brew options homebrew-ffmpeg/ffmpeg/ffmpeg

Use the included script to fully install ffmpeg with the common options.

#!/usr/bin/env bash
set -e
readonly CHROMAPRINT_KEG_URL="https://gist.githubusercontent.com/blackrobot/5ff60ea171ecf4a2e3050717260b035d/raw/b7d6045d853fbbde376ae72d718414246ceaf434/chromaprint.rb"
readonly S_BOLD="$(tput bold)"
readonly S_RESET="$(tput sgr0)"
function log {
printf '[%s] %b%s%b\n' "$(date '+%x %X')" "$S_BOLD" "$1" "$S_RESET"
}
log "Tapping the homebrew-ffmpeg keg source"
( set -x ; brew tap homebrew-ffmpeg/ffmpeg ) ; echo
# pin the ffmpeg keg as the primary package source
log "Pinning the homebrew-ffmpeg keg as the primary source"
( set -x ; brew pin homebrew-ffmpeg/ffmpeg ) ; echo
log "Tapping the chromaprint keg source"
( set -x ; brew tap "$CHROMAPRINT_KEG_URL" ) ; echo
log "Pinning the chromaprint keg as the primary source"
( set -x ; brew tap-pin "$CHROMAPRINT_KEG_URL" ) ; echo
log "Uninstalling chromaprint if it already exists"
( set -x ; brew uninstall chromaprint ) || true ; echo
log "Uninstalling ffmpeg if it already exists"
( set -x ; brew uninstall ffmpeg ) || true ; echo
log "Updating brew"
( set -x ; brew update ) ; echo
log "Installing ffmpeg from homebrew-ffmpeg with extensions enabled"
(
set -x
brew install homebrew-ffmpeg/ffmpeg/ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-libvmaf \
--with-libxml2 \
--with-openjpeg \
--with-openssl \
--with-webp \
--with-xvid \
--with-zimg
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment