在Linux中部署FFmpeg开源视频压缩环境过程简单笔记

2022-12-23 19:11:10 浏览数 (2)

下面是在Linux中部署FFmpeg和相关类库全过程的简单记录,如下:

编译安装yasm

代码语言:javascript复制
tar zxvf ./yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make
make install

编译安装x264

代码语言:javascript复制
tar xvfj ./x264.tar.bz2
cd x264
./configure --enable-shared
make
make install

编译安装lame

代码语言:javascript复制
tar zxvf ./lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --enable-shared
make && make install

编译安装libogg

代码语言:javascript复制
tar zxvf ./libogg-1.3.2.tar.gz
cd libogg-1.3.2
./configure --enable-shared
make && make install

编译安装libvorbis

代码语言:javascript复制
tar zxvf ./libvorbis-1.3.4.tar.gz
cd libvorbis-1.3.4
./configure
make && make install

编译安装faac

代码语言:javascript复制
tar zxvf ./faac-1.28.tar.gz
cd faac-1.28
./configure
make && make install

编译安装ffmpeg

代码语言:javascript复制
tar xvfj ./ffmpeg-2.5.1.tar.bz2
cd ffmpeg-2.5.1
./configure --prefix=/usr/local/ffmpeg2 --enable-libmp3lame --enable-libvorbis --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libx264 --enable-postproc --enable-ffserver --enable-ffplay
make && make install

# 继续编译 qt-faststart
./configure
make tools/qt-faststart
cp -a tools/qt-faststart /usr/bin/

将libx264写进ldconfig

代码语言:javascript复制
locate libx264.so.142 #会显示/usr/local/lib/libx264.so.142
ln -s libx264.so.142 libx264.so
vi /etc/ld.so.conf.d/libx264.conf #写入/usr/local/lib
ldconfig

阳光部落原创,更多内容请访问 http://www.sunbloger.com/

0 人点赞