Skip to content

examples : add FFmpeg v7.0 support to ffmpeg-transcode.cpp #3038

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

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

fujimotos
Copy link
Contributor

Closes #3011

FFmpeg introduced a new channel layout API that uses AVChannelLayout
interface in v6.0. It subsequently dropped the old bitmask-based API
in v7.0.

This updates decode_audio() to support the new channel layout API,
so that we can compile whisper-cli and whisper-server with FFmpeg
v7.0 or later.

FFmpeg introduced a new channel layout API that uses `AVChannelLayout`
interface in v6.0. It subsequently dropped the old bitmask-based API
in v7.0.

This updates decode_audio() to support the new channel layout API,
so that we can compile `whisper-cli` and `whisper-server` with FFmpeg
v7.0 or later.

Tested on on Ubuntu 24.10 with FFmpeg v7.0.2.

Signed-off-by: Fujimoto Seiji <[email protected]>
@fujimotos
Copy link
Contributor Author

Note: I can confirm that this patch enables us to build whisper.cpp
on Ubuntu 24.10.

$ # Compile test on Ubuntu 24.10 with FFmpeg v7.0.2
$ git checkout sf/ffmpeg-v7
$ cmake -B build -D WHISPER_FFMPEG=yes
$ cmake --build build

$ # Confirm that it works fine with FFmpeg v7
$ ./build/bin/whisper-cli -np -m models/ggml-tiny.bin jfk.opus
[00:00:00.000 --> 00:00:10.560]   And so, my fellow Americans, ask not what your country can do for you, ask what you can do for your country.

The API change I mentioned above was introduced by the following commits
in the upstream project.

I believe this changeset has already landed on Fedora 41 and Ubuntu 24.10.

@danbev danbev merged commit f8a3509 into ggml-org:master Apr 15, 2025
50 checks passed
fujimotos added a commit to fujimotos/whisper.cpp that referenced this pull request Apr 20, 2025
…3038)

FFmpeg introduced a new channel layout API that uses `AVChannelLayout`
interface in v6.0. It subsequently dropped the old bitmask-based API
in v7.0.

This updates decode_audio() to support the new channel layout API,
so that we can compile `whisper-cli` and `whisper-server` with FFmpeg
v7.0 or later.

Tested on on Ubuntu 24.10 with FFmpeg v7.0.2.

Signed-off-by: Fujimoto Seiji <[email protected]>
@fujimotos fujimotos deleted the sf/ffmpeg-v7 branch April 25, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decoding example fails to build with ffmpeg 7.0.2
2 participants