Ubuntu 16.04上的FFMPEG编译失败 – 目标’libavcodec / libfdk-aacenc.o’的配方失败

我已经跟进了https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu上记录的安装步骤,并且已经在Ubuntu 16.04上成功安装了具有libfdk_aac支持的FFMPEG。 最近,当我想再设置一个新的编码生态系统时,我遇到了一个如下错误:

CC libavcodec / libfdk-aacdec.o在/home/sn/ffmpeg_build/include/fdk-aac/aacdecoder_lib.h:457:0中包含的文件中,来自libavcodec / libfdk-aacdec.c:20:

/home/sn/ffmpeg_build/include/fdk-aac/FDK_audio.h:735:30:警告:’FDKinitLibInfo’已定义但未使用[-Wunused-function] static FDK_AUDIO_INLINE void FDKinitLibInfo(LIB_INFO * info){^ / home / sn / ffmpeg_build / include / fdk-aac / FDK_audio.h:745:1:警告:’FDKlibInfo_getCapabilities’已定义但未使用[-Wunused-function] FDKlibInfo_getCapabilities(const LIB_INFO * info,FDK_MODULE_ID module_id){^

/home/sn/ffmpeg_build/include/fdk-aac/FDK_audio.h:757:29:警告:’FDKlibInfo_lookup’已定义但未使用[-Wunused-function] static FDK_AUDIO_INLINE INT FDKlibInfo_lookup(const LIB_INFO * info,^

CC libavcodec / libfdk-aacenc.o libavcodec / libfdk-aacenc.c:在函数’aac_encode_init’中:libavcodec / libfdk-aacenc.c:293:34:错误:’AACENC_InfoStruct {aka struct}’没有名为’encoderDelay’的成员avctx-> initial_padding = info.encoderDelay; ^

在/home/sn/ffmpeg_build/include/fdk-aac/aacenc_lib.h:1026:0中包含的文件中,来自libavcodec / libfdk-aacenc.c:20:libavcodec / libfdk-aacenc.c:顶级:/ home /sn/ffmpeg_build/include/fdk-aac/FDK_audio.h:735:30:警告:’FDKinitLibInfo’已定义但未使用[-Wunused-function] static FDK_AUDIO_INLINE void FDKinitLibInfo(LIB_INFO * info){^

/home/sn/ffmpeg_build/include/fdk-aac/FDK_audio.h:745:1:警告:’FDKlibInfo_getCapabilities’已定义但未使用[-Wunused-function] FDKlibInfo_getCapabilities(const LIB_INFO * info,FDK_MODULE_ID module_id){^

/home/sn/ffmpeg_build/include/fdk-aac/FDK_audio.h:757:29:警告:’FDKlibInfo_lookup’已定义但未使用[-Wunused-function] static FDK_AUDIO_INLINE INT FDKlibInfo_lookup(const LIB_INFO * info,^ ffbuild / common .mak:60:目标’libavcodec / libfdk-aacenc.o’的配方失败了make:*** [libavcodec / libfdk-aacenc.o]错误1

似乎libfdk或ffmpeg存储库上有更新导致此错误。

经过一些调查,我在ffmpeg邮件列表上找到了答案。 正如http://www.ffmpeg-archive.org/ffmpeg-compilation-error-on-libfdk-acc-ubuntu16-04-td4685096.html所述 ,由于libfdk API的更新,引发了错误。 没有ffmpeg版本可以匹配这个新版本的API列表。

在ffmpeg团队更新代码之前,合理的解决方案是降级libfdk。 为此,您可以在https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu上更改libfdk的安装说明,如下所示:

cd ~/ffmpeg_sources && \ git -C fdk-aac pull 2> /dev/null || git clone --depth 11 https://github.com/mstorsjo/fdk-aac && \ cd fdk-aac && \ autoreconf -fiv && \ ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \ make && \ make install 

请注意,我们更改了深度参数并将其设置为11.这适用于此答案的当前日期。 如果将来发布任何新的提交或发布包,您应该增加深度编号以适合您可以使用它编译ffmpeg的正确版本。

另一个解决方案反映在https://github.com/mstorsjo/fdk-aac/issues/93以及http://www.ffmpeg-archive.org/ffmpeg-compilation-error-on-libfdk-acc- ubuntu16-04-td4685096.html是关于在源代码上应用补丁。 可以通过https://github.com/libav/libav/commit/141c960e21d2860e354f9b90df136184dd00a9a8访问补丁本身。 我们必须在文本编辑器中手动打开源文件,转到路径中显示的行号并用+添加行,并用 – 删除行。