After installing ffmpeg through homebrew without any errors and after confirming that it has been linked, I get the following error when trying to run it:

dyld: Library not loaded: @rpath/libopenh264.5.dylib
  Referenced from: /opt/miniconda3/lib/libavcodec.58.54.100.dylib
  Reason: image not found
zsh: abort      ffmpeg

I've tried it through pip, conda, the ffmpeg.org website, all to no avail. Any and all help would be greatly appreciated!

  • 1
    How are you using Homebrew (the reference to /opt looks odd)?
    – nohillside
    Dec 22 '20 at 13:19
  • 1
    What version of macOS have you got. The homebrew build is bad it has picked up stuff from conda which it should not do. That looks like a bug in homebrew
    – mmmmmm
    Dec 22 '20 at 13:43
  • What was the exact hombrew command you used - Given trac.ffmpeg.org/wiki/CompilationGuide/… the install is not a simple one "Since v2.0, Homebrew does not offer options for its core formulae anymore. Users who want to build ffmpeg with additional libraries (including non-free ones) need to use so-called taps from third party repositories. These repositories are not maintained by Homebrew. "
    – mmmmmm
    Dec 22 '20 at 13:50
  • I had tried to install it through homebrew several times before, and brew uninstall wasn't enough, I guess. Before homebrew, I had also tried with pip, and conda, and both of them failed (for context, I only need ffmpeg as a dependency for a Python package that uses this aspect of Matplotlib's functionality). So I thought I was doomed, but I finally got rid of everything, followed these instructions and it worked! Jan 3 at 2:30
  • ffmpeg isn't working because the dynamic linker found a copy of libavcodec not installed by Homebrew before it found the one installed by Homebrew. This is not specifically Homebrew's problem. May 22 at 16:48

I can't offer anything to help you w/ Homebrew. I gave it up some time ago due to various issues like this. I can recommend MacPorts as a package manager for macOS.

Once you have MacPorts installed, you should be able to install a functional copy of ffmpeg. I installed ffmpeg on my macOS Catalina system some time ago, and use it regularly without a hitch. Following is the port command I used:

% sudo port install ffmpeg +nonfree

nonfree was one of the "variants" available for ffmpeg; variants are explained here on the MacPorts site

  • Note that +nonfree will explicitly cause ffmpeg to be built from source for legal reasons. Which is 100% okay if OP wants nonfree libraries, but I'm trying to fight the misconception of "MacPorts builds everything from source." 😉 May 22 at 0:26
  • @Wowfunhappy The ffmpeg port was especially twitchy during the move from Python 3.8 to 3.9... MacPorts did not coordinate that well at all and dependencies would cause even the GPL port to be rebuilt. May 22 at 16:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .