Linux安装和配置ffmpeg

2019-10-31  本文已影响0人  Peakmain

安装pkg-config工具

0.28版本直接下载
pkg-config-0.28.tar.gz
命令

wget https://pkg-config.freedesktop.org/releases/pkg-config-0.28.tar.gz
下载地址:https://pkg-config.freedesktop.org/releases/
解压
tar zxvf pkg-config-0.28.tar.gz
进入文件之后:make&&make install

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 && sudo make install

编译 fdk-aac

wget https://jaist.dl.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-0.1.6.tar.gz
tar xvf fdk-aac-0.1.6.tar.gz
cd fdk-aac-0.1.6
./configure
make && sudo make install

wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar -xzf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure
make && sudo make install

安装nasm

wget https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.gz
tar xvf nasm-2.13.03.tar.gz
cd nasm-2.13.03
./configure
make && sudo make install

安装x264

wget http://mirror.yandex.ru/mirrors/ftp.videolan.org/x264/snapshots/last_x264.tar.bz2
bunzip2 last_x264.tar.bz2
tar -vxf last_x264.tar
cd last_x264
./configure --enable-static --enable-shared --disable-asm --disable-avs
make && sudo make install

安装ffmpeg

从ffmpeg官网下载代码编译, 编译方法如下:

wget -c https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2
bunzip2 ffmpeg-4.0.2.tar.bz2
tar -xvf ffmpeg-4.0.2.tar
cd ffmpeg-4.0.2
./configure --prefix=/usr/local/peakmain/ffmpeg --enable-gpl --enable-small --arch=x86_64 --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-filter=delogo --enable-debug --disable-optimizations --enable-shared
make && sudo make install

错误解决

vi /etc/ld.so.conf
/usr/local/peakmain/ffmpeg/ffmpeg/lib
/usr/local/lib

ln -s /usr/local/lib/libx264.so.157 /usr/lib64/libx264.so.157

查看配置是否成功

修改bash_profile文件

vi ~/.bash_profile

添加自己ffmpeg下的bin目录

unset PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/user/local/SDL2/lib/pkgconfig:/usr/local/ffmpeg/ffmpeg/lib/pkgconifg
export PATH=$PATH:/usr/local/peakmain/ffmpeg/ffmpeg/bin

输出ffmpeg


image.png

补充

wget https://bitbucket.org/multicoreware/x265/downloads/x265_2.7.tar.gz
tar zxvf x265.tar.gz
cd x265/source
cmake -G "Unix Makefiles"
make && make install

wget [http://libsdl.org/release/SDL-1.2.15.tar.gz](http://libsdl.org/release/SDL-1.2.15.tar.gz)
tar zxvf SDL-1.2.15.tar.gz
cd SDL-1.2.15
./configure --prefix=/usr
make -j16
sudo make install

wget http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
tar zxvf 1.2rc1.tar.gz
cd speex-1.2rc1
./configure
make && make install

wget http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz

wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz

上一篇下一篇

猜你喜欢

热点阅读