ffmpeg-2.5.2 在centos 6.4 x86_64 上编译安装全过程

原始编译参数

./configure –extra-libs=-ldl –prefix=/opt/ffmpeg –enable-avresample –disable-debug –enable-nonfree –enable-gpl –enable-version3 –enable-libpulse –enable-libopencore-amrnb –enable-libopencore-amrwb –disable-decoder=amrnb –disable-decoder=amrwb –enable-libx264 –enable-libx265 –enable-libfdk-aac –enable-libvorbis –enable-libmp3lame –enable-libopus –enable-libvpx –enable-libspeex –enable-libass –enable-avisynth –enable-libsoxr –enable-libxvid –enable-libvo-aacenc

最终优化后编译参数

./configure –extra-libs=-ldl –prefix=/opt/ffmpeg –enable-avresample –disable-debug –enable-nonfree –enable-gpl –enable-version3 –enable-libpulse –enable-libopencore-amrnb –enable-libopencore-amrwb –disable-decoder=amrnb –disable-decoder=amrwb –enable-libx264 –enable-libfdk-aac –enable-libvorbis –enable-libmp3lame –enable-libopus –enable-libvpx –enable-libspeex –enable-libass –enable-avisynth –enable-libsoxr –enable-libxvid –enable-libvo-aacenc

为了不用编译每个包,添加如下yum源: 创建一个这样的文件: /etc/yum.repos.d/linuxtech.repo

[linuxtech]
name=LinuxTECH
baseurl=http://pkgrepo.linuxtech.net/el6/release/
enabled=1
gpgcheck=1
gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET

  1. yasm/nasm not found or too old. Use –disable-yasm for a crippled build.
    sudo yum install yasm.x86_64 yasm-devel.x86_64
  2. ERROR: libass not found using pkg-config
    sudo yum install libass.x86_64 libass-devel.x86_64
  3. ERROR: libfdk_aac not found
    wget http://iweb.dl.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-0.1.3.tar.gz
    tar xzf fdk-aac-0.1.3.tar.gz
    cd fdk-aac-0.1.3
    ./configure
    make
    sudo make install
  4. ERROR: libmp3lame >= 3.98.3 not found
    sudo yum install libmp3lame.x86_64 libmp3lame-devel.x86_64
  5. ERROR: libopencore_amrnb not found
    sudo yum install libopencore-amr-devel.x86_64 libopencore-amr.x86_64
  6. ERROR: libopencore_amrwb not found
    sudo yum install libopencore-amr-devel.x86_64 libopencore-amr.x86_64
  7. ERROR: opus not found using pkg-config sudo yum install opus.x86_64 opus-devel.x86_64
  8. ERROR: libpulse not found using pkg-config
    sudo yum install pulseaudio-libs.x86_64 pulseaudio-libs-devel.x86_64
  9. ERROR: libsoxr not found
    sudo yum install libsoxr-devel.x86_64 libsoxr.x86_64
  10. ERROR: speex not found using pkg-config
    sudo yum install speex.x86_64 speex-devel.x86_64
  11. ERROR: libvo_aacenc not found
    wget http://hivelocity.dl.sourceforge.net/project/opencore-amr/vo-aacenc/vo-aacenc-0.1.3.tar.gz
    tar xzf vo-aacenc-0.1.3.tar.gz
    cd vo-aacenc-0.1.3
    ./configure
    make
    sudo make install
  12. ERROR: libvorbis not found
    sudo yum install libvorbis-devel.x86_64 libvorbis.x86_64
  13. ERROR: libvpx decoder version must be >=0.9.1
    sudo yum install libvpx.x86_64 libvpx-devel.x86_64
  14. ERROR: libx264 not found
    git clone git://git.videolan.org/x264.git
    cd x264
    ./configure –enable-static
    make
    sudo  make install
    sudo ldconfig
  15. ERROR: x265 not found using pkg-config
    去掉编译参数: –enable-libx265
    ./configure –extra-libs=-ldl –prefix=/opt/ffmpeg –enable-avresample –disable-debug –enable-nonfree –enable-gpl –enable-version3 –enable-libpulse –enable-libopencore-amrnb –enable-libopencore-amrwb –disable-decoder=amrnb –disable-decoder=amrwb –enable-libx264 –enable-libfdk-aac –enable-libvorbis –enable-libmp3lame –enable-libopus –enable-libvpx –enable-libspeex –enable-libass –enable-avisynth –enable-libsoxr –enable-libxvid –enable-libvo-aacenc
  16. ERROR: libxvid not found
    sudo yum install libxvidcore-devel.x86_64 libxvidcore.x86_64
  17. ./ffmpeg: error while loading shared libraries: libvo-aacenc.so.0: cannot open shared object file: No such file or directory

    sudo vim /etc/ld.so.conf.d/local_lib.conf

    /usr/local/lib

    sudo ldconfig

发表评论

电子邮件地址不会被公开。 必填项已用*标注


*