-2

我正在尝试按照https://trac.ffmpeg.org/wiki/CompilationGuide/Centoshttps://developer.nvidia.com/ffmpeg上的指南在 Nvidia 支持下编译 ffmpeg 。我最终得到了以下命令:

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --enable-pthreads --disable-w32threads --prefix="$HOME/ffmpeg_build" --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include -I/usr/local/cuda/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib -L/usr/local/cuda/lib64" --extra-libs='-lpthread -lm' --bindir="$HOME/bin" --enable-gpl --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp

我得到了奇妙的错误

错误:使用 pkg-config 找不到 x265

查看ffbuild/config.log显示以下错误:

gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I/home/agilbert/ffmpeg_build/include -I/usr/local/cuda/include -std=c11 -fomit-frame-pointer -pthread -I/home/agilbert/ffmpeg_build/include -I/usr/include/freetype2 -I/home/agilbert/ffmpeg_build/include/opus -I/home/agilbert/ffmpeg_build/include/opus -I/home/agilbert/ffmpeg_build/include -I/home/agilbert/ffmpeg_build/include -I/home/agilbert/ffmpeg_build/include -I/home/agilbert/ffmpeg_build/include -I/home/agilbert/ffmpeg_build/include -I/home/agilbert/ffmpeg_build/include -I/home/agilbert/ffmpeg_build/include -I/home/agilbert/ffmpeg_build/include -L/home/agilbert/ffmpeg_build/lib -c -o /tmp/ffconf.MfrVBc4k/test.o /tmp/ffconf.MfrVBc4k/test.c
In file included from /tmp/ffconf.MfrVBc4k/test.c:1:0:
/home/agilbert/ffmpeg_build/include/x265.h:1753:40: error: expected ';', ',' or ')' before '&' token
 FILE* x265_csvlog_open(const x265_param& param);
                                        ^
/home/agilbert/ffmpeg_build/include/x265.h:1757:40: error: expected ';', ',' or ')' before '&' token
 void x265_csvlog_frame(const x265_param& param, const x265_picture& pic);
                                        ^
/home/agilbert/ffmpeg_build/include/x265.h:1762:64: error: expected ';', ',' or ')' before '&' token
 void x265_csvlog_encode(x265_encoder *encoder, const x265_stats& stats, int argc, char** argv);
                                                                ^
/home/agilbert/ffmpeg_build/include/x265.h:1766:36: error: expected ';', ',' or ')' before '&' token
 void x265_dither_image(x265_picture& pic, int picWidth, int picHeight, int16_t *errorBuf, int bitDepth);
                                    ^
/home/agilbert/ffmpeg_build/include/x265.h:1815:50: error: expected ';', ',' or ')' before '&' token
     FILE*         (*csvlog_open)(const x265_param&);
                                                  ^
/home/agilbert/ffmpeg_build/include/x265.h:1816:51: error: expected ';', ',' or ')' before '&' token
     void          (*csvlog_frame)(const x265_param&, const x265_picture&);
                                                   ^
/home/agilbert/ffmpeg_build/include/x265.h:1817:67: error: expected ';', ',' or ')' before '&' token
     void          (*csvlog_encode)(x265_encoder*, const x265_stats&, int, char**);
                                                                   ^
/home/agilbert/ffmpeg_build/include/x265.h:1818:47: error: expected ';', ',' or ')' before '&' token
     void          (*dither_image)(x265_picture&, int, int, int16_t*, int);
                                               ^
/home/agilbert/ffmpeg_build/include/x265.h:1820:1: warning: no semicolon at end of struct or union [enabled by default]
 } x265_api;
 ^

gcc 版本是 gcc-4.8.5-16.el7.x86_64

根据以下问题:是的 - x265 是按照https://trac.ffmpeg.org/wiki/CompilationGuide/Centos安装的,是的 pkg-config 正在找到它。编译错误让我认为我缺少 --pkg-config-flags 选项的标志,但我找不到一个有效的标志。

有谁知道我应该将什么传递给 pkg-config 以使其启用 x265?

4

1 回答 1

1

万一这对其他人有帮助,我最终发现,--enable-libx265当您还指定--enable-nvenc.

我仍然不知道编译错误是什么,但是--enable-nvenc您可以使用基于 nVidia 的 GPU 加速在 H.265 中进行编码。

于 2017-11-15T17:54:31.260 回答