yum install yasm -y
wget http://ffmpeg.org/releases/ffmpeg-3.3.4.tar.bz2
tar -jxvf ffmpeg-3.3.4.tar.bz2
cd ffmpeg-3.3.4
./configure --enable-shared --prefix=/usr/local/ffmpeg
make
make install
修改文件/etc/ld.so.conf 內容增長/usr/local/ffmpeg/lib/
vim /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/ffmpeg/lib/
使修改生效
ldconfig
執行 /usr/local/ffmpeg/bin/ffmpeg -version
顯示
ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
configuration: --enable-shared --prefix=/usr/local/ffmpeg
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
ffmpeg安裝第三方編碼器(encoder)庫,ffmpeg編碼h264
h264
https://github.com/ShiftMediaProject/x264
./configure --help看看它的幫助信息
./configure --enable-shared --enable-static
make && make install
libx264.so和libx264.a就會複製到/usr/local/lib
mp3lame
下載代碼
http://sourceforge.net/projects/lame/files/lame/
./configure
make && make install
從新編譯ffmpeg
./configure --enable-gpl --enable-libx264 --enable-libmp3lame --enable-shared --prefix=/usr/local/ffmpeg
make && make install
修改文件/etc/ld.so.conf 內容增長/usr/local/ffmpeg/lib/
vim /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/ffmpeg/lib/
/usr/local/lib
使修改生效
ldconfig
執行 /usr/local/ffmpeg/bin/ffmpeg -version