Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audacity 3.2 for Mac Silicon does not find homebrew-installed ffmpeg #3747

Closed
M-D-M opened this issue Oct 3, 2022 · 15 comments · Fixed by #3755
Closed

Audacity 3.2 for Mac Silicon does not find homebrew-installed ffmpeg #3747

M-D-M opened this issue Oct 3, 2022 · 15 comments · Fixed by #3755
Assignees
Labels
bug An error, undesired behaviour, or missed functionality

Comments

@M-D-M
Copy link

M-D-M commented Oct 3, 2022

Bug description

Summary:

Wanted to use the new version of Audacity for Mac Silicon (thanks for making it!), but unfortunately it does not find the version of ffmpeg I have installed through homebrew.

Further Description:

Installed Mac Silicon version of Audacity via .dmg file. Selected "do not replace previous version" when prompted via MacOS, because I wanted to keep the previous x86 version handy.

When loading Audacity, it says that ffmpeg libraries aren't loaded, and when trying to direct it to the folder with ffmpeg libraries installed via Homebrew (/opt/homebrew/Cellar/ffmpeg/*/lib), it does not find the right library.

Steps to reproduce

Download Mac Silicon version of Audacity.

Install using dmg file, and select "do not replace previous version" when prompted via MacOS.

Open Audacity, and get the popup about ffmpeg libraries not found.

Expected behavior

Audacity finds the ffmpeg libraries.

Actual behavior

Audacity is saying that "ffmpeg library not found."

Audacity Version

current master / alpha / nightly build

Operating system

macOS

Additional context

I have ffmpeg installed and in my path via Homebrew -- confirmed with "ffmpeg -version" from a cli.

It looks like audacity is wanting a file named "ffmpeg.64bit.dylib", but the files in the ffmpeg folder have names like the following:

libavcodec.59.37.100.dylib
libavdevice.59.7.100.dylib
libavfilter.8.44.100.dylib
libavformat.59.27.100.dylib

@M-D-M M-D-M added the bug An error, undesired behaviour, or missed functionality label Oct 3, 2022
@LWinterberg LWinterberg changed the title Audacity 3.2 for Mac Silicon does not find ffmpeg Audacity 3.2 for Mac Silicon does not find homebrew-installed ffmpeg Oct 3, 2022
@dozzzzer
Copy link
Contributor

dozzzzer commented Oct 3, 2022

@M-D-M we will look into it, but for now please download and install the FFmpeg package for OS X from Buanzo's website. Once it's installed, Audacity should recognize it automatically.

@crsib crsib self-assigned this Oct 4, 2022
@crsib crsib linked a pull request Oct 4, 2022 that will close this issue
6 tasks
@dozzzzer
Copy link
Contributor

dozzzzer commented Oct 4, 2022

Verified. I don't see the original issue anymore. Now Audacity recognizes FFmpeg installed by Homebrew.

image

@M-D-M
Copy link
Author

M-D-M commented Oct 5, 2022

Thank you for looking into this so quickly!

Following up on the ffmpeg package from Buanzo's website -- I already had the x86 libs installed, but could not find any arm libs.

@M-D-M
Copy link
Author

M-D-M commented Oct 5, 2022

Was this the key line that solves the issue?

paths.emplace_back(wxT("/opt/homebrew/lib"));

FYI: I tried opening up Audacity for Mac Silicon again, and manually entered this location ("/opt/homebrew/lib") into the preferences, and now the ffmpeg libs are correctly found:

Screen Shot 2022-10-04 at 9 59 02 PM

@dozzzzer
Copy link
Contributor

dozzzzer commented Oct 5, 2022

I already had the x86 libs installed, but could not find any arm libs.

AFAIK, there's one .dmg package for both architectures.

@LWinterberg
Copy link
Member

(I think the buanzo website was updated after this issue was made)

@dozzzzer dozzzzer closed this as completed Oct 5, 2022
@dozzzzer dozzzzer self-assigned this Oct 5, 2022
@LWinterberg LWinterberg added this to the Audacity 3.2.1 milestone Oct 5, 2022
@crsib
Copy link
Contributor

crsib commented Oct 5, 2022

The pull request for this issue is not merged. Why is it closed?

@crsib crsib reopened this Oct 5, 2022
@crsib crsib closed this as completed Oct 5, 2022
@BlkPingu
Copy link

I have this issue too with 3.3.3

@savagekevin
Copy link

savagekevin commented Oct 2, 2023

same for me as original post a year ago, installed Audacity 3.3.3 then installed Homebrew, then home-brew installed ffmpeg, after restarts, Audacity doesn't find it, using the preferences to direct it, Audacity asks for "libavformat.dylib" but any such files that one points to in the home-brew installation don't seem to please Audacity

@martingeorgiu
Copy link

I also had the same issue, but I then found out that my local installation of FFmpeg was behaving weirdly. I've reinstalled the FFmpeg from brew like described here https://stackoverflow.com/a/77115222/5647161 and then Audacity immediately found it.

@puppycodes
Copy link

This was also the case for me that some update created an issue with libsodium leading to my ffmpeg woes, fix was simply to brew upgrade and then it found the lib. It might be helpful to include a verbose error instead of just not finding the library in audacity if thats possible ;)

@lgarron
Copy link

lgarron commented May 8, 2024

Anyone else still having issues? I installed both audacity (3.5.1) and ffmpeg (7.0.1) through Homebrew (4.2.21-43-g020d994) on macOS (14.4.1) but Audacity doesn't find ffmpeg.

Here is what I have installed:

> find /opt -iname "*ffmpeg*"
/opt/homebrew/bin/ffmpeg
/opt/homebrew/var/homebrew/linked/ffmpeg
/opt/homebrew/lib/python3.11/site-packages/yt_dlp/postprocessor/ffmpeg.py
/opt/homebrew/lib/python3.11/site-packages/yt_dlp/postprocessor/__pycache__/ffmpeg.cpython-311.pyc
/opt/homebrew/lib/python3.12/site-packages/yt_dlp/postprocessor/ffmpeg.py
/opt/homebrew/lib/python3.12/site-packages/yt_dlp/postprocessor/__pycache__/ffmpeg.cpython-312.pyc
/opt/homebrew/lib/python3.12/site-packages/torio/utils/__pycache__/ffmpeg_utils.cpython-312.pyc
/opt/homebrew/lib/python3.12/site-packages/torio/utils/ffmpeg_utils.py
/opt/homebrew/lib/python3.12/site-packages/torio/lib/libtorio_ffmpeg5.so
/opt/homebrew/lib/python3.12/site-packages/torio/lib/_torio_ffmpeg4.so
/opt/homebrew/lib/python3.12/site-packages/torio/lib/_torio_ffmpeg5.so
/opt/homebrew/lib/python3.12/site-packages/torio/lib/libtorio_ffmpeg4.so
/opt/homebrew/lib/python3.12/site-packages/torio/lib/_torio_ffmpeg6.so
/opt/homebrew/lib/python3.12/site-packages/torio/lib/libtorio_ffmpeg6.so
/opt/homebrew/lib/python3.12/site-packages/torchaudio/utils/__pycache__/ffmpeg_utils.cpython-312.pyc
/opt/homebrew/lib/python3.12/site-packages/torchaudio/utils/ffmpeg_utils.py
/opt/homebrew/lib/python3.12/site-packages/torchaudio/_backend/ffmpeg.py
/opt/homebrew/lib/python3.12/site-packages/torchaudio/_backend/__pycache__/ffmpeg.cpython-312.pyc
/opt/homebrew/opt/ffmpeg
/opt/homebrew/opt/ffmpeg@7
/opt/homebrew/opt/ffmpeg@6
/opt/homebrew/opt/ffmpeg@5
/opt/homebrew/Cellar/ffmpeg
/opt/homebrew/Cellar/ffmpeg/7.0_1/bin/ffmpeg
/opt/homebrew/Cellar/ffmpeg/7.0_1/.brew/ffmpeg.rb
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-all.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-filters.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-codecs.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-utils.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-resampler.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-bitstream-filters.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-protocols.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-scaler.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-devices.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man1/ffmpeg-formats.1
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/ffmpeg
/opt/homebrew/Cellar/yt-dlp/2024.4.9_1/libexec/lib/python3.12/site-packages/yt_dlp/postprocessor/ffmpeg.py
/opt/homebrew/Cellar/fish/3.7.1/share/fish/completions/ffmpeg.fish
/opt/homebrew/Cellar/xdg-ninja/0.2.0.2/share/xdg-ninja/programs/ffmpeg.json
/opt/homebrew/share/man/man1/ffmpeg-all.1
/opt/homebrew/share/man/man1/ffmpeg-filters.1
/opt/homebrew/share/man/man1/ffmpeg.1
/opt/homebrew/share/man/man1/ffmpeg-codecs.1
/opt/homebrew/share/man/man1/ffmpeg-utils.1
/opt/homebrew/share/man/man1/ffmpeg-resampler.1
/opt/homebrew/share/man/man1/ffmpeg-bitstream-filters.1
/opt/homebrew/share/man/man1/ffmpeg-protocols.1
/opt/homebrew/share/man/man1/ffmpeg-scaler.1
/opt/homebrew/share/man/man1/ffmpeg-devices.1
/opt/homebrew/share/man/man1/ffmpeg-formats.1
/opt/homebrew/share/ffmpeg
/opt/homebrew/share/fish/completions/ffmpeg.fish
/opt/homebrew/include/libavformat
/opt/homebrew/lib/pkgconfig/libavformat.pc
/opt/homebrew/lib/libavformat.61.1.100.dylib
/opt/homebrew/lib/libavformat.61.dylib
/opt/homebrew/lib/libavformat.dylib
/opt/homebrew/lib/libavformat.a
/opt/homebrew/Cellar/ffmpeg/7.0_1/include/libavformat
/opt/homebrew/Cellar/ffmpeg/7.0_1/lib/pkgconfig/libavformat.pc
/opt/homebrew/Cellar/ffmpeg/7.0_1/lib/libavformat.61.1.100.dylib
/opt/homebrew/Cellar/ffmpeg/7.0_1/lib/libavformat.61.dylib
/opt/homebrew/Cellar/ffmpeg/7.0_1/lib/libavformat.dylib
/opt/homebrew/Cellar/ffmpeg/7.0_1/lib/libavformat.a
/opt/homebrew/Cellar/ffmpeg/7.0_1/share/man/man3/libavformat.3
/opt/homebrew/share/man/man3/libavformat.3

I've tried all of the following paths, and none of them worked:

  • /opt/homebrew/lib
  • /opt/homebrew/lib/libavformat.dylib
  • /opt/homebrew/lib/libavformat.61.dylib
  • /opt/homebrew/lib/libavformat.61.1.100.dylib
  • /opt/homebrew/Cellar/ffmpeg/7.0_1/lib/ (the folder that the previous /opt/homebrew/lib/libavformat*.dylib files are symlinked from)
  • /opt/homebrew/var/homebrew/linked/ffmpeg/lib (a folder symlink to /opt/homebrew/Cellar/ffmpeg/7.0_1/lib/)
  • /opt/homebrew/include/libavformat

Examples of me trying to tell Audacity to use either the folder or file path where libavformat.dylib 100% exists:

Screenshot 2024-05-07 at 21 24 02
Screenshot 2024-05-07 at 21 25 12

The result remains "FFmpeg library not found" every single time:
Screenshot 2024-05-07 at 21 25 34

… am I missing something?

@lgarron
Copy link

lgarron commented May 8, 2024

Okay, I tried the following:

  1. Download the recommended installer, which installs files to /Library/Application Support/audacity and does nothing else, according to Suspicious Package:

Screenshot 2024-05-07 at 21 34 18
Screenshot 2024-05-07 at 21 34 14

  1. Restart Audacity and verify that it can find the ffmpeg files:

Screenshot 2024-05-07 at 21 33 16

  1. Run:
sudo rm -rf "/Library/Application Support/audacity/libs"
sudo ln -s "/opt/homebrew/var/homebrew/linked/ffmpeg/lib" "/Library/Application Support/audacity/libs"
  1. Restart ffmpeg and observe:

Screenshot 2024-05-07 at 21 35 38

Given that the ffmpeg libraries in /opt/homebrew/var/homebrew/linked/ffmpeg/lib are a superset of those placed by the installer (except for version number differences), there seems to be some compatibility issue that does not allow Audacity 3.5.1 to detect the libraries from ffmpeg 7.0.1 as valid on my system.

So I'm back at the start, but this indicates that it's not a path search problem, but a binary compatiblity problem or something similar.

@lgarron
Copy link

lgarron commented May 8, 2024

Okay, I think I figured it out:

ffmpeg versions 5 and 6 work.

brew install ffmpeg@5
sudo rm -rf "/Library/Application Support/audacity/libs"
sudo ln -s "/opt/homebrew/opt/ffmpeg@5/lib" "/Library/Application Support/audacity/libs"

brew install ffmpeg@6
sudo rm -rf "/Library/Application Support/audacity/libs"
sudo ln -s "/opt/homebrew/opt/ffmpeg@6/lib" "/Library/Application Support/audacity/libs"

But version 7 doesn't work:

brew install ffmpeg # version 7 as of 2024-04-05: https://github.com/Homebrew/homebrew-core/pull/168136
sudo rm -rf "/Library/Application Support/audacity/libs"
sudo ln -s "/opt/homebrew/opt/ffmpeg/lib" "/Library/Application Support/audacity/libs"

Homebrew updated to version 7 of ffmpeg about a month ago, and I must have picked up that version in an upgrade: Homebrew/homebrew-core#168136

This is covered by #6389 , which is fixed in #6241

@lgarron
Copy link

lgarron commented May 8, 2024

Just to summarize the best workaround for now:

brew install ffmpeg@6
sudo rm -rf "/Library/Application Support/audacity/libs"
sudo ln -s "/opt/homebrew/opt/ffmpeg@6/lib" "/Library/Application Support/audacity/libs"

And once the next version of Audacity is released, you can clean up with:

sudo rm -rf "/Library/Application Support/audacity/libs"
brew uninstall ffmpeg@6

Since ffmpeg@6 is tagged with a version, it is not linked into the default system paths and will not interfere with ffmpeg 7 as the system default for other purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error, undesired behaviour, or missed functionality
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

9 participants