whisper.cpp icon indicating copy to clipboard operation
whisper.cpp copied to clipboard

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

Open brlin-tw opened this issue 1 year ago • 2 comments

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 avatar Jun 27 '24 03:06 brlin-tw

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

brlin-tw avatar Jun 27 '24 03:06 brlin-tw

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

WilliamTambellini avatar Jul 31 '24 21:07 WilliamTambellini