CentOS 6.7 x64上編譯安裝ffmpeg的教程

來源:互聯網
上載者:User

系統資訊
[root@LookBack ~]# getconf LONG_BIT
64
[root@LookBack ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)
yum源資訊,這裡就不再說epel和rpmforge源的安裝了
[root@LookBack ~]# yum repolist
已載入外掛程式:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.us.leaseweb.net
 * extras: mirror.us.leaseweb.net
 * updates: mirror.us.leaseweb.net
倉庫標識                                           倉庫名稱                                                                                 狀態
base                                               CentOS-6 - Base                                                                           6,575
epel                                               Extra Packages for Enterprise Linux 6 - x86_64                                           11,766
extras                                             CentOS-6 - Extras                                                                            35
rpmforge                                           RHEL 6 - RPMforge.net - dag                                                               4,718
updates                                            CentOS-6 - Updates                                                                          298
repolist: 23,392
[root@LookBack ~]#
清理一些系統上已有的軟體包
yum remove libvpx libogg libvorbis libtheora libx264 x264 ffmpeg yasm -y
更新系統和安裝編譯必要環境
yum clean all && yum makecache && yum update -y
yum install gcc gcc-c++ automake autoconf libtool nasm git subversion dos2unix -y
編譯安裝Xvid
wget http://downloads.xvid.org/downloads/xvidcore-1.3.4.tar.gz
tar xf xvidcore-1.3.4.tar.gz
cd xvidcore/build/generic
./configure
make && make install
ldconfig
cd ../../../
編譯安裝Lame
wget http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz
tar xf lame-3.99.5.tar.gz
cd lame-3.99.5/
./configure
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
ldconfig
編譯安裝AudioCoding
wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz
tar xf faac-1.28.tar.gz
cd faac-1.28/
dos2unix bootstrap && ./bootstrap
dos2unix configure && ./configure
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
ldconfig && cd ..
Linux之CentOS 6.7 x64上編譯安裝ffmpeg
如果在編譯的時候出現上圖中的錯誤,請注釋錯誤提示的行重新編譯即可,如下操作
[root@LookBack ~/faac-1.28]# sed -i '126s@^@//@' common/mp4v2/mpeg4ip.h
[root@LookBack ~/faac-1.28]# make clean && make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
ldconfig && cd ..
編譯安裝opencore-amr
wget http://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-0.1.4.tar.gz
tar xf fdk-aac-0.1.4.tar.gz
cd fdk-aac-0.1.4/
./configure
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
ldconfig
cd ..
編譯安裝libogg
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
tar xf libogg-1.3.2.tar.gz
cd libogg-1.3.2/
./configure
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
ldconfig
cd ..
編譯安裝libvorbis
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz
tar xf libvorbis-1.3.5.tar.gz
cd libvorbis-1.3.5/
./configure
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
ldconfig
cd ..
編譯安裝libtheora
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
tar xf libtheora-1.1.1.tar.bz2
cd libtheora-1.1.1/
./configure
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
ldconfig
cd ..
編譯安裝Aacenc
wget http://sourceforge.net/projects/opencore-amr/files/vo-aacenc/vo-aacenc-0.1.3.tar.gz
tar xf vo-aacenc-0.1.3.tar.gz
cd vo-aacenc-0.1.3/
./configure
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
ldconfig
cd ..
編譯安裝yasm
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xf yasm-1.3.0.tar.gz
cd yasm-1.3.0/
./configure
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
cd ..
編譯安裝Libvpx
git clone https://chromium.googlesource.com/webm/libvpx.git
cd libvpx/
./configure
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
cd ..
配置lib
export LD_LIBRARY_PATH=/usr/local/lib/
echo /usr/local/lib >> /etc/ld.so.conf.d/custom-libs.conf
ldconfig
編譯安裝x264
git clone git://git.videolan.org/x264.git
cd x264/
./configure --enable-static
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
ldconfig
cd ..
編譯安裝ffmpeg
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
export PKG_CONFIG_PATH
./configure --prefix="/usr/local/ffmpeg_build" --extra-cflags="-I/usr/local/ffmpeg_build/include" --extra-ldflags="-L/usr/local/ffmpeg_build/lib" --bindir="/usr/local/bin" --extra-libs=-ldl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvo-aacenc --enable-libxvid --disable-ffplay --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads
echo $?
make -j `awk '/processor/{i++}END{print i}' /proc/cpuinfo` && make install
cd ..

驗證安裝

[root@LookBack ~]# which ffmpeg
/usr/local/bin/ffmpeg
[root@LookBack ~]# ffmpeg
ffmpeg version N-75247-g1d2beb6 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
  configuration: --prefix=/usr/local/ffmpeg_build --extra-cflags=-I/usr/local/ffmpeg_build/include --extra-ldflags=-L/usr/local/ffmpeg_build/lib --bindir=/usr/local/bin --extra-libs=-ldl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvo-aacenc --enable-libxvid --disable-ffplay --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  1.100 / 57.  1.100
  libavformat    57.  0.100 / 57.  0.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  1.100 /  6.  1.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.