[Linux] Binary fails on Ubuntu 24.04 due to missing libavcodec.so.58 (Dependency Mismatch)
**Problem Description:**
I attempted to run the `faster-whisper-xxl` Linux binary on **Ubuntu 24.04**. The execution fails immediately because the system provides FFmpeg 6.x (`libavcodec.so.60`), but the binary is dynamically linked against the older FFmpeg 4.x (`libavcodec.so.58`), which is default in Ubuntu 22.04 but removed in 24.04.
**Error Log:**
```text
faster_whisper - ERROR - ffmpeg: error while loading shared libraries: libavcodec.so.58: cannot open shared object file: No such file or directory
```
**Root Cause:**
The provided Linux binary is not statically linked with FFmpeg libraries. It relies on system-level libraries (`libavcodec.so.58`, `libavutil.so.56`, etc.) which are deprecated and unavailable in newer Linux distributions like Ubuntu 24.04.
### Solution / Workaround
I successfully resolved this issue by manually side-loading the required FFmpeg 4.4.1 libraries from the Ubuntu 22.04 (Jammy) repositories.
**Steps to reproduce the fix:**
1. Download the required `.deb` packages (FFmpeg 4.4.1 era):
```bash
wget http://security.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/libavcodec58_4.4.1-3ubuntu5_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/libavutil56_4.4.1-3ubuntu5_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/libswresample3_4.4.1-3ubuntu5_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/libavformat58_4.4.1-3ubuntu5_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/libavfilter7_4.4.1-3ubuntu5_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/libswscale5_4.4.1-3ubuntu5_amd64.deb
```
2. Extract the shared object files (`.so`) from these packages. (e.g., using `dpkg -x` or `ar`).
```bash
for file in *.deb; do dpkg -x "$file" .; done
ls usr/lib/x86_64-linux-gnu/
libavcodec.so.58 libavfilter.so.7 libavformat.so.58 libavutil.so.56 libswresample.so.3 libswscale.so.5
libavcodec.so.58.134.100 libavfilter.so.7.110.100 libavformat.so.58.76.100 libavutil.so.56.70.100 libswresample.so.3.9.100 libswscale.so.5.9.100
```
4. Place the extracted library files into the application's local directory:`Faster-Whisper-XXL/_xxl_data/`
```bash
cp usr/lib/x86_64-linux-gnu/lib* Faster-Whisper-XXL/_xxl_data/
```
4. The application now runs correctly on Ubuntu 24.04 as it loads the legacy libraries from the local folder.
I noticed that you have already fixed this issue in **Faster-Whisper-XXL Pro r3.256.1** (`Fixed: ffmpeg: error while loading shared libraries [Linux]`). Perhaps it is time to release a new version of **Faster-Whisper-XXL** to include this fix as well?
关闭于 2026-01-06 1 条评论