Centos6.5 安装FFmpeg支持视频解码,视频处理

一.yasm 安装
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make && make install

二.lame安装,用于mp3编码
wget https://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz
tar -zxvf lame-3.99.5.tar.gz
cd ./lame-3.99.5
./configure
make && make install

三.nasm安装
wget http://www.nasm.us/pub/nasm/releasebuilds/2.13/nasm-2.13.tar.gz
tar zxvf nasm-2.13.tar.gz
cd nasm-2.13
./configure
make && make install

四.x264安装
# git clone http://git.videolan.org/git/x264.git
./configure --enable-shared --enable-static --enable-mp4
make && make install

五.FFmpeg安装
FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。采用LGPL或GPL许可证。它提供了录制、转换以及流化音视频的完整解决方案。
wget http://ffmpeg.org/releases/ffmpeg-3.4.1.tar.bz2
tar -jxvf ffmpeg-3.4.1.tar.bz2
./configure --prefix=/usr/local/ --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-zlib --enable-bzlib --enable-libmp3lame --enable-pic
./configure --prefix=/usr/local/ --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-zlib --enable-bzlib --enable-libmp3lame --enable-libx264 --enable-pic

make &&make install

六.验证
ffmpeg -version
报错: ffmpeg: error while loading shared libraries: libavdevice.so.55: cannot open shared object file: No such file or directory 
添加动态链接库,
vi /etc/ld.so.conf
加入
/usr/local/lib
/usr/local/lib64
保存,执行
ldconfig
ffmpeg -version

ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
configuration: --prefix=/usr/local/ --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-zlib --enable-bzlib --enable-libmp3lame --enable-pic
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100

参考:https://blog.csdn.net/clj198606061111/article/details/53054270

你可能感兴趣的:(Linux系统运维)