Rico Picone
Rico Picone

Reputation: 401

ffmpeg installation: pkg-config can't find package (using Homebrew)

I'm trying to install ffmpeg with Homebrew using the command

brew install ffmpeg --with-freetype

but get

ERROR: freetype2 not found using pkg-config

If I check /usr/local/lib/pkgconfig, the file freetype2.pc exists. In fact,

pkg-config --list-all

includes freetype2.

I've tried reinstalling pkg-config and freetype with Homebrew, reinstalling git, updating Homebrew, upgrading Homebrew, uninstalling and reinstalling all Homebrew packages, etc.

brew doctor gives mostly a bunch of warnings about dylibs, config scripts, and header files, probably from recently moving to a new machine and copying files. I thought the config scripts might be related, but they're all pyenv shims.

I'm ok with a nuclear fix, but I feel like I've tried every nuclear option I know other than creating an entirely new user account.

Upvotes: 0

Views: 2255

Answers (1)

Rico Picone
Rico Picone

Reputation: 401

I was finally successful, although I'm not sure if every step that follows was required.

  1. Use brew bundle to save a list of all brews in the file ./Brewfile.
  2. Uninstall Homebrew a la these instructions. (Also rm the contents of the local directory the uninstaller recommends.)
  3. brew bundle to reinstall brews from Brewfile (must have working directory with Brewfile).
  4. Uninstall xquartz via brew cask uninstall xquartz
  5. Install ffmpeg with brew install ffmpeg --with-freetype ... no error!
  6. Install xquartz with brew cask install xquartz

I think steps 4-6 might have worked without 1-3, but I'm not positive because after step 3 I had a new error from the ffmpeg installation:

libavdevice/xcbgrab.c:25:10: fatal error: 'xcb/xcb.h' file not found

I thought to try uninstalling xquartz due to this obscure comment in a thread describing this second error.

Upvotes: 2

Related Questions