ggerganov / whisper.cpp

Port of OpenAI's Whisper model in C/C++
MIT License
34.53k stars 3.52k forks source link

whisper.cpp build fails when FFmpeg support is enabled on Ubuntu 24.04 #2263

Open brlin-tw opened 2 months ago

brlin-tw commented 2 months ago

Build output:

[ 57%] Building CXX object examples/CMakeFiles/common.dir/ffmpeg-transcode.cpp.o                                                                                       

    ...stripped...

examples/ffmpeg-transcode.cpp: In function ‘int decode_audio(audio_buffer*, s16**, int*)’:                             
examples/ffmpeg-transcode.cpp:207:5: error: ‘av_register_all’ was not declared in this scope                           
  207 |     av_register_all(); // from avformat. Still a must-have call for ffmpeg v3! (can be skipped for later versions)                                             
      |     ^~~~~~~~~~~~~~~ 

Refer Caffe2 uses FFMPEG functions that are deprecated in FFMPEG 4.0 and gone in 5.0 · Issue #72254 · pytorch/pytorch it seems that the av_register_all function call is obsoleted since FFmpeg 5.0.

brlin-tw commented 2 months ago

Reproduced both on version 1.6.2 and the current development snapshot(revision bf4cb4abad4e).

WilliamTambellini commented 1 month ago

as explained in the comment, av_register_all still required for ffmpeg3. you could perhaps retouch with something like

#if ffmpeg version < 4
av_register_all();
#endif