Audacity Fedora "Failed to find compatible ffmpeg libraries"

Help for Audacity on GNU/Linux.
Forum rules
ImageThis forum is for Audacity on GNU/Linux.
Please state:
  • which version of Linux you are using,
  • the exact three-section version number of Audacity from Help menu > About Audacity,
  • whether you installed your distribution's release, PPA version, or compiled Audacity from source code.

Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade (see https://www.audacityteam.org/download/).
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
Saler
Posts: 2
Joined: Wed Mar 17, 2021 6:29 pm
Operating System: Linux Fedora/RHEL

Audacity Fedora "Failed to find compatible ffmpeg libraries"

Post by Saler » Wed Mar 17, 2021 7:12 pm

Audacity 2.4.2
Fedora 33 64-bit
Gnome 3.38.4

As you might guess from the subject line, this is an issue with FFmpeg. When attempting to export to m4a format I receive the message that "Audacity needs the file 'libavformat.so.55' to import and export audio via FFmpeg." The file libavformat.so.55 is not on my system but libavformat.so.58 & libavformat.so.58.45.100 are on my system in the user/lib64 folder. My research indicates that libavformat.so.58 is not compatible with Audacity 2.4.2.

The files libavformat.so.57 and libavformat.so.57.83.100 are on my system in the /var/lib/snapd/snap/spotify/41/usr/lib/x86_64-linux-gnu folder. I believe that libavformat.so.57 is compatible with 2.4.2 but when I browse to- and select libavformat.so.57 I get the "Failed to find compatible ffmpeg libraries" message.

I appreciate any guidance that you can provide.

steve
Site Admin
Posts: 81257
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity Fedora "Failed to find compatible ffmpeg libraries"

Post by steve » Wed Mar 17, 2021 8:02 pm

Saler wrote:
Wed Mar 17, 2021 7:12 pm
The files libavformat.so.57 and libavformat.so.57.83.100 are on my system in the /var/lib/snapd/snap/spotify/41/usr/lib/x86_64-linux-gnu folder.
That library may not be accessible to Audacity because of the Snapd security restrictions.

How was Audacity installed? Is that also a Snapd package?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Saler
Posts: 2
Joined: Wed Mar 17, 2021 6:29 pm
Operating System: Linux Fedora/RHEL

Re: Audacity Fedora "Failed to find compatible ffmpeg libraries"

Post by Saler » Wed Mar 17, 2021 9:05 pm

Audacity was installed using the Fedora software installer. It was not installed using Snapd. FFmpeg came with, I assume, from the Spotify installation. I will try to uninstall Spotify to determine if that helps with my problem.

prk3
Posts: 3
Joined: Mon Apr 05, 2021 1:10 am
Operating System: Linux Fedora/RHEL

Re: Audacity Fedora "Failed to find compatible ffmpeg libraries"

Post by prk3 » Mon Apr 05, 2021 1:41 am

Audacity 2.4.2 (installed from official Fedora repos)
Fedora 33 64-bit

I have a similar problem. Importing an mp4 file gives me this error message:
"<file> is an Advanced Audio Coding file. Without the optional FFmpeg library, Audacity cannot open this type of file. Otherwise, you need to convert it to a supported audio format, such as WAV of AIFF".

This is understandable. So I go to Edit > Preferences > Libraries and click on FFmpeg library "Locate...". A popup shows up saying "Failed to find compatible FFmpeg libraries.". Nothing weird still, I may have an incompatible version installed on my system. "Locate FFmpeg" window tells me to find libavformat.so.55.

I started looking for ffmpeg sources with avformat version 55 here: https://ffmpeg.org/olddownload.html. The first one I tried was FFmpeg 2.3.6 "Mandelbrot". I downloaded it, compiled with --prefix and --enable-shared flags, and located it in Audacity.
The path in the input box is "/home/user/apps/ffmpeg-2.0.7/lib/libavformat.so" (although I tried pointing to files ending with .so.55 and .so.55.12.100 too). I click ok to confirm FFmpeg path and get this popup: "Failed to find compatible FFmpeg libraries". Clicking ok takes me back to the preferences window.

I tried another version of FFmpeg: FFmpeg 2.0.7 "Nameless", but the outcome was exactly the same.

Audacity does not print anything to the stdout. I am not really sure if I'm doing something wrong or if that's a bug in Audacity.

steve
Site Admin
Posts: 81257
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity Fedora "Failed to find compatible ffmpeg libraries"

Post by steve » Mon Apr 05, 2021 10:49 am

prk3 wrote:
Mon Apr 05, 2021 1:41 am
Audacity does not print anything to the stdout.
Launch Audacity, then look in the Audacity log ("Help menu > Diagnostics > Show Log").
What's in there?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

prk3
Posts: 3
Joined: Mon Apr 05, 2021 1:10 am
Operating System: Linux Fedora/RHEL

Re: Audacity Fedora "Failed to find compatible ffmpeg libraries"

Post by prk3 » Tue Apr 06, 2021 12:36 am

Here is log content.

Code: Select all

01:42:33: Audacity 2.4.2
Log Cleared.
01:42:40: Trying to load FFmpeg libraries...
01:42:40: mLibAVFormatPath ('/home/prk3/apps/ffmpeg-2.0.7/lib/libavformat.so.55') is not empty. Loading from it.
01:42:40: Checking for monolithic avformat from '/home/prk3/apps/ffmpeg-2.0.7/lib/libavformat.so.55'.
01:42:40: Error: libavcodec.so.55: cannot open shared object file: No such file or directory
01:42:40: Loading avutil from ''.
01:42:40: Error: .so: cannot open shared object file: No such file or directory
01:42:40: Loading avcodec from ''.
01:42:40: Error: .so: cannot open shared object file: No such file or directory
01:42:40: Loading avformat from '/home/prk3/apps/ffmpeg-2.0.7/lib/libavformat.so.55'.
01:42:40: Error: libavcodec.so.55: cannot open shared object file: No such file or directory
01:42:40: Error: Failed to load FFmpeg libraries.
01:42:40: Trying to load FFmpeg libraries from system paths. File name is 'libavformat.so.55'.
01:42:40: Checking for monolithic avformat from 'libavformat.so.55'.
01:42:40: Error: libavformat.so.55: cannot open shared object file: No such file or directory
01:42:40: Loading avutil from ''.
01:42:40: Error: .so: cannot open shared object file: No such file or directory
01:42:40: Loading avcodec from ''.
01:42:40: Error: .so: cannot open shared object file: No such file or directory
01:42:40: Loading avformat from 'libavformat.so.55'.
01:42:40: Error: libavformat.so.55: cannot open shared object file: No such file or directory
01:42:40: Error: Failed to load FFmpeg libraries.
01:42:42: Error: Failed to find compatible FFmpeg libraries.
01:42:42: Looking for FFmpeg libraries...
01:42:42: mLibAVFormatPath ('/home/prk3/apps/ffmpeg-2.0.7/lib/libavformat.so.55') is not empty.
01:42:45: User-specified path = '/home/prk3/apps/ffmpeg-2.0.7/lib/libavformat.so.55'
01:42:45: User-specified FFmpeg file exists. Success.
01:42:45: Trying to load FFmpeg libraries...
01:42:45: mLibAVFormatPath ('/home/prk3/apps/ffmpeg-2.0.7/lib/libavformat.so.55') is not empty. Loading from it.
01:42:45: Checking for monolithic avformat from '/home/prk3/apps/ffmpeg-2.0.7/lib/libavformat.so.55'.
01:42:45: Error: libavcodec.so.55: cannot open shared object file: No such file or directory
01:42:45: Loading avutil from ''.
01:42:45: Error: .so: cannot open shared object file: No such file or directory
01:42:45: Loading avcodec from ''.
01:42:45: Error: .so: cannot open shared object file: No such file or directory
01:42:45: Loading avformat from '/home/prk3/apps/ffmpeg-2.0.7/lib/libavformat.so.55'.
01:42:45: Error: libavcodec.so.55: cannot open shared object file: No such file or directory
01:42:45: Error: Failed to load FFmpeg libraries.
01:42:45: Trying to load FFmpeg libraries from system paths. File name is 'libavformat.so.55'.
01:42:45: Checking for monolithic avformat from 'libavformat.so.55'.
01:42:45: Error: libavformat.so.55: cannot open shared object file: No such file or directory
01:42:45: Loading avutil from ''.
01:42:45: Error: .so: cannot open shared object file: No such file or directory
01:42:45: Loading avcodec from ''.
01:42:45: Error: .so: cannot open shared object file: No such file or directory
01:42:45: Loading avformat from 'libavformat.so.55'.
01:42:45: Error: libavformat.so.55: cannot open shared object file: No such file or directory
01:42:45: Error: Failed to load FFmpeg libraries.
01:42:46: Error: Failed to find compatible FFmpeg libraries.
It looks like either Audacity or libavformat is trying to load libavcodec.so.55 but fails. The libavcodec file is in the same folder. Maybe putting the compiled libraries in system directories would solve the problem. I will check that tomorrow.

steve
Site Admin
Posts: 81257
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity Fedora "Failed to find compatible ffmpeg libraries"

Post by steve » Tue Apr 06, 2021 9:22 am

Compiling Audacity with "-audacity_use_ffmpeg=loaded" works for me:

Code: Select all

cmake -Daudacity_use_ffmpeg=loaded ..
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

prk3
Posts: 3
Joined: Mon Apr 05, 2021 1:10 am
Operating System: Linux Fedora/RHEL

Re: Audacity Fedora "Failed to find compatible ffmpeg libraries"

Post by prk3 » Tue Apr 06, 2021 7:55 pm

I managed to get ffmpeg working. I think the issue was that ffmpeg library files were not able to locate each other because the weren't placed in system library folders. I used `--enable-rpath` and Audacity accepted the lib. Here is a guide for anyone who cant get ffmpeg to work:
  1. See what version of libavformat your Audacity build expects in Edit > Preferences > Libraries > FFmpeg Library Locate. Mine was 55.
  2. Find and download a release of FFmpeg sources that provide libavformat in that version.
  3. Extract the archive and compile FFmpeg with 3 commands:
  4. ./configure --prefix=SOME_PATH_WHERE_THE_LIB_WILL_BE --enable-rpath --enable-shared
  5. make
  6. make install
  7. Select THAT_PATH_WITH_LIB/lib/libavformat.so.EXPECTED_VERSION
No need to recompile Audacity or install an old FFmpeg system-wide. Good luck!

Post Reply