基于GPU编译FFmpeg[nvidia方案]

具体操作说明详见http://www.linuxfromscratch.org/blfs/view/svn/multimedia/ffmpeg.html

一、安装faad2 
faad2-2.7.tar.gz (要选择这个扩展名的文件)
http://www.audiocoding.com/downloads.html 
安装方法:
tar zxvf faad2-2.7.tar.gz
cd faad2-2.7
autoreconf -vif  
./configure  --with-mp4v2 --enable-shared  
make  
make install  

二、faac 
faac-1.28.tar.gz  (要选择这个扩展名的文件)
http://www.audiocoding.com/downloads.html
安装方法:
tar zxvf faac-1.28.tar.gz  
cd faac-1.28  
./bootstrap  
./configure 
make   
make install  


三、安装fdk-aac
下载https://downloads.sourceforge.net/opencore-amr/fdk-aac-0.1.5.tar.gz
安装方法:
tar zxvf fdk-aac-0.1.5.tar.gz
cd fdk-aac-0.1.5
./configure --prefix=/usr --disable-static
make
make install

四、安装lame
下载https://downloads.sourceforge.net/lame/lame-3.100.tar.gz
安装方法:
tar xzvf lame-3.100.tar.gz 
cd lame-3.100
./configure --prefix=/usr --enable-mp3rtp --disable-static
make
make pkghtmldir=/usr/share/doc/lame-3.100 install

五、安装libvorbis-dev
yum install libvorbis-dev

六、安装speex
下载https://downloads.xiph.org/releases/speex/speex-1.2.0.tar.gz
安装方法:
tar zxvf speex-1.2.0.tar.gz
cd speex-1.2.0
./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/speex-1.2.0
make
make install

七、安装FriBidi
下载https://github.com/fribidi/fribidi/releases/download/v1.0.1/fribidi-1.0.1.tar.bz2
安装方法:
tar xjf fribidi-1.0.1.tar.bz2 
cd fribidi-1.0.1
./configure 
make
make install

八、安装libass
下载https://github.com/libass/libass/releases/download/0.14.0/libass-0.14.0.tar.xz
安装方法:
tar xvf libass-0.14.0.tar.xz
cd libass-0.14.0


九、安装ffmpeg3.4.2
./configure --enable-shared --prefix=/usr/local/ffmpeg2 --enable-libnpp --enable-libmp3lame --enable-libvorbis --enable-gpl --enable-pthreads --enable-debug --enable-version3 --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-ffserver --enable-ffplay --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --disable-x86asm --extra-cflags="-I/usr/local/cuda-9.1/include" --extra-ldflags="-L/usr/local/cuda-9.1/lib64" 
make -j 30
make install

十、配置环境变量
vim /etc/profile
在文件最后添加
export FFMPEG_HOME=/usr/local/ffmpeg2
export PATH=$FFMPEG_HOME/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$FFMPEG_HOME/lib:/usr/local/lib
执行:wq保存退出,在执行如下命令使其生效
source /etc/profile

你可能感兴趣的:(ffmpeg)