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.
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.
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:
“ 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.
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.
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:
See what version of libavformat your Audacity build expects in Edit > Preferences > Libraries > FFmpeg Library Locate. Mine was 55.
Find and download a release of FFmpeg sources that provide libavformat in that version.
Extract the archive and compile FFmpeg with 3 commands: