对`x264_encoder_open_125'的未定义引用

Vis*_*hal 8 ffmpeg ubuntu-12.04

在Ubuntu 12.04上安装ffmpeg时

我收到了以下错误

libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/root/ffmpeg/libavcodec/libx264.c:492: undefined reference to `x264_encoder_open_125'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
Run Code Online (Sandbox Code Playgroud)

我按照http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide上的说明进行操作

有人知道这个错误吗?

Mla*_* B. 9

对于已经通过包管理系统安装了x264的人来说,这是一个典型问题.您可以通过以下两种方式解决此问题:

  1. 通过包管理系统从系统中卸载现有的x264:

    # apt-get remove x264
    
    Run Code Online (Sandbox Code Playgroud)

    从源代码编译新的x264

  2. 不要卸载x264软件包,而是编译新的x264然后编译你的ffmpeg,告诉它使用新编译的x264库,通过使用提到的LD_LIBRARY_PATH环境变量指定编译的x264库所在的目录:

    LD_LIBRARY_PATH=/path/to/my/compiled/x264/library ./configure --enable-libx264 ...
    
    Run Code Online (Sandbox Code Playgroud)

可在以下链接中找到更多信息: