Skip to content

Commit 33a25e4

Browse files
authored
docs : document how to use 'WHISPER_FFMPEG' build option (#3029)
FFmpeg integration was introduced in 1b51fdf by William Tambellini, but not mentioned in the main documentation. Add a short guide on how to enable the feature. Confirmed to work on both Ubuntu 24.04 and Fedora 39. Signed-off-by: Fujimoto Seiji <[email protected]>
1 parent 43f5030 commit 33a25e4

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,37 @@ Run the inference examples as usual, for example:
375375
- If you have trouble with Ascend NPU device, please create a issue with **[CANN]** prefix/tag.
376376
- If you run successfully with your Ascend NPU device, please help update the table `Verified devices`.
377377

378+
## FFmpeg support (Linux only)
379+
380+
If you want to support more audio formats (such as Opus and AAC), you can turn on the `WHISPER_FFMPEG` build flag to enable FFmpeg integration.
381+
382+
First, you need to install required libraries:
383+
384+
```bash
385+
# Debian/Ubuntu
386+
sudo apt install libavcodec-dev libavformat-dev libavutil-dev
387+
388+
# RHEL/Fedora
389+
sudo dnf install libavcodec-free-devel libavformat-free-devel libavutil-free-devel
390+
```
391+
392+
Then you can build the project as follows:
393+
394+
```bash
395+
cmake -B build -D WHISPER_FFMPEG=yes
396+
cmake --build build
397+
```
398+
399+
Run the following example to confirm it's working:
400+
401+
```bash
402+
# Convert an audio file to Opus format
403+
ffmpeg -i samples/jfk.wav jfk.opus
404+
405+
# Transcribe the audio file
406+
./build/bin/whisper-cli --model models/ggml-base.en.bin --file jfk.opus
407+
```
408+
378409
## Docker
379410

380411
### Prerequisites

0 commit comments

Comments
 (0)