16

I'm trying to install FFmpeg on my mac.
When I do

brew install ffmpeg --with-chromaprint --with-fdk-aac
--with-fontconfig --with-freetype --with-frei0r --with-game-music-emu --with-libass --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-librsvg --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-rubberband --with-sdl2 --with-snappy --with-speex --with-tesseract --with-theora --with-tools --with-two-lame --with-wavpack --with-webp --with-x265 --with-xz --with-zeromq --with-zimg

This happens when I try to use FFmpeg

dyld: Library not loaded: /usr/local/opt/rubberband/lib/librubberband.2.dylib  
Referenced from: /usr/local/bin/ffmpeg  
Reason: image not found  
Abort trap: 6
Joycon
  • 165
  • 1
  • 4

2 Answers2

23

This should fix the problem:

$ brew reinstall ffmpeg
nbari
  • 25,603
  • 10
  • 76
  • 131
  • I confirm this solved my issue when I had following error also: `dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib Referenced from: /usr/local/opt/p11-kit/lib/libp11-kit.0.dylib Reason: image not found Abort trap: 6` – Mehmet Kaplan Jan 07 '22 at 07:00
  • It solved my issue after a macOS upgrading – Noil Mar 23 '22 at 11:36
2

There is a common issue with brew when upgrading Mac Os as laid out on brew.sh:

Upgrading macOS Upgrading macOS can cause errors like the following:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.54.dylib configure: error: Cannot find libz Following a macOS upgrade it may be necessary to >reinstall the Xcode Command Line Tools and brew upgrade

all installed formula:

xcode-select --install
brew upgrade

1. Step: uninstall command-line-tools

rm -rf /Library/Developer/CommandLineTools

(You probably have to sudo that command, but since you only should use sudo when you know, what you do, I didnt put it in the command). Source: Aaron Brager on Stackoverflow.

2. step: backup installed brew packages

Then you should back up your installed brew packages by

brew bundle

this command creates a brews.txt at your current location. check the content by

nano brews.txt

and leave it by pressing ctrl+x. remember the folder you saved that file in!

source: Tom Lankhorst.

3 step: uninstall homebrew

next step is to uninstall homebrew and all packages by

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

source: Ming C on stackoverflow.

4. step: reinstall everything

after that you install the command line-tools again by

xcode-select --install

and install homebrew again by

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

and last but not least you go into the folder you saved the bundle in (if it is in your users home folder, you type "cd ~") and restore all installed packages by

brew bundle

Common Issues

In my case where two packages that could not be installed. One was r, and the error read:

Could not symlink bin/R

Target /usr/local/bin/R

solution:

brew link --overwrite r

The other was Chromium:

Error: It seems there is already an App at '/Applications/Chromium.app'.

solution:

rm -r /Applications/Chromium.app/
brew cask install chromium
Community
  • 1
  • 1
Jonathan
  • 443
  • 3
  • 9
  • I didn't need to uninstall xcode, i just uninstall and reinstalled homebrew. I had to use sudo for the uninstall – Daniel Kobe Sep 03 '20 at 09:48
  • "$ brew reinstall ffmpeg" was necessary for me, following macOS upgrade from 10.13 to 10.15 – Noil Mar 23 '22 at 11:37