使用libwebp错误编译ffmpeg

时间:2018-04-29 22:25:06

标签: c ffmpeg webp

所以我试图用--enable-libwebp编译ffmpeg。但我收到以下错误:

In file included from libavcodec/libwebpenc_animencoder.c:30:0:
/usr/include/webp/mux.h:101:13: error: expected identifier or ‘(’ before ‘int’
 WEBP_EXTERN(int) WebPGetMuxVersion(void);
             ^~~
/usr/include/webp/mux.h:107:13: error: expected identifier or ‘(’ before ‘WebPMux’
 WEBP_EXTERN(WebPMux*) WebPNewInternal(int);
             ^~~~~~~
/usr/include/webp/mux.h:120:13: error: expected identifier or ‘(’ before ‘void’
 WEBP_EXTERN(void) WebPMuxDelete(WebPMux* mux);
             ^~~~
/usr/include/webp/mux.h:126:13: error: expected identifier or ‘(’ before ‘WebPMux’
 WEBP_EXTERN(WebPMux*) WebPMuxCreateInternal(const WebPData*, int, int);
             ^~~~~~~
/usr/include/webp/mux.h:163:13: error: expected identifier or ‘(’ before ‘WebPMuxError’
 WEBP_EXTERN(WebPMuxError) WebPMuxSetChunk(
             ^~~~~~~~~~~~
/usr/include/webp/mux.h:179:13: error: expected identifier or ‘(’ before ‘WebPMuxError’
 WEBP_EXTERN(WebPMuxError) WebPMuxGetChunk(
             ^~~~~~~~~~~~
/usr/include/webp/mux.h:192:13: error: expected identifier or ‘(’ before ‘WebPMuxError’
 WEBP_EXTERN(WebPMuxError) WebPMuxDeleteChunk(
             ^~~~~~~~~~~~
/usr/include/webp/mux.h:225:13: error: expected identifier or ‘(’ before ‘WebPMuxError’
 WEBP_EXTERN(WebPMuxError) WebPMuxSetImage(
             ^~~~~~~~~~~~
/usr/include/webp/mux.h:245:13: error: expected identifier or ‘(’ before ‘WebPMuxError’
 WEBP_EXTERN(WebPMuxError) WebPMuxPushFrame(
             ^~~~~~~~~~~~
/usr/include/webp/mux.h:263:13: error: expected identifier or ‘(’ before ‘WebPMuxError’
 WEBP_EXTERN(WebPMuxError) WebPMuxGetFrame(
             ^~~~~~~~~~~~
...

我需要使用某个版本的libwebp吗?任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

我刚从https://www.ffmpeg.org/download.html

下载了源代码

加载webp库

sudo apt install libwebp-dev

有版本

apt-cache policy libwebp-dev 
libwebp-dev:
  Installed: 0.4.4-1
  Candidate: 0.4.4-1

然后我使用了这种语法

./configure  --enable-libwebp 

make -j8  # on a quad core, else use -j4

sudo make install

这一切都运行得很好......完成的disted二进制现在给出了

ffmpeg -version
ffmpeg version N-90893-gcae6f80 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
configuration: --enable-libwebp
libavutil      56. 17.100 / 56. 17.100
libavcodec     58. 19.100 / 58. 19.100
libavformat    58. 13.100 / 58. 13.100
libavdevice    58.  4.100 / 58.  4.100
libavfilter     7. 21.100 /  7. 21.100
libswscale      5.  2.100 /  5.  2.100
libswresample   3.  2.100 /  3.  2.100

我在ubuntu 16.04 x86_64