linux centos 搭建 ffmpeg、lame服务

需要文件:

ffmpeg-3.3.2.tar.bz2

lame-3.99.5.tar.gz

yasm-1.3.0.tar.gz

第一步:安装lame服务

解压文件,并且进入解压后目录,操作如下命令

./configure --prefix=/usr/local/ --enable-shared
make 
make install

第二步:安装yasm服务

解压文件,并且进入解压后目录,操作如下命令

./configure --prefix=/usr/local/
make 
make install

第三步:安装ffmpeg

解压文件,并且进入解压后目录,操作如下命令

./configure --prefix=/usr/local/  --enable-shared  --enable-libmp3lame
make
make install

安装完成了,测试

ffmpeg -i a.amr -acodec libmp3lame a.mp3

a.amr转换为 a.mp3

注意:

问题1:error while loading shared libraries: libavdevice.so.57: cannot open shared object file: No such file or directory

解决方案:修改 etc/ld.so.conf,并执行ldconfig命令

修改前

include ld.so.conf.d/*.conf

修改后

include ld.so.conf.d/*.conf
/usr/local/ffmpeg/lib
/usr/local/lib

问题2:

bzip2: Cannot exec: No such file or directory

需要安装bz2

yum install bzip2

特别感谢:http://blog.chinaunix.net/uid-23069658-id-4018842.html

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
3. 安装FFmpeg 1) 指定第三方插件安装默认目录 [root@localhost ffmpeg]# vi /etc/ld.so.conf include ld.so.conf.d/*.conf /usr/local/bin /usr/local/lib 2) 安装各插件 安装lame [root@localhost ffmpeg]# tar -zxvf lame-3.99.5.tar.gz [root@localhost lame-3.99.5]# cd lame-3.99.5 [root@localhost lame-3.99.5]# ./configure --enable-shared [root@localhost lame-3.99.5]# make && make install [root@localhost lame-3.99.5]# ldconfig 安装yasm [root@localhost ffmpeg]# tar -zxvf yasm-1.2.0.gz [root@localhost yasm-1.2.0]# cd yasm-1.2.0 [root@localhost yasm-1.2.0]# ./configure --enable-shared [root@localhost yasm-1.2.0]# make && make install [root@localhost yasm-1.2.0]# ldconfig 安装xvidcore (注意目录位置,不在直接的解压后的文件下) [root@localhost ffmpeg]# tar -zxvf xvidcore-1.1.3.tar.gz [root@localhost ffmpeg]# cd xvidcore-1.1.3/build/generic/ [root@localhost generic]# ./configure [root@localhost generic]# make && make install [root@localhost generic]# ldconfig 安装x264 (注意格式为.tar.bz2) [root@localhost ffmpeg]# bunzip2 last_x264.tar.bz2 [root@localhost ffmpeg]# tar -xvf last_x264.tar [root@localhost ffmpeg]# cd x264-snapshot-20121030-2245/ [root@localhost x264-snapshot-20121030-2245]# ./configure --enable-shared [root@localhost x264-snapshot-20121030-2245]# make && make install [root@localhost x264-snapshot-20121030-2245]# ldconfig 安装a52dec [root@localhost ffmpeg]# tar -zxvf a52dec-0.7.4.tar.gz [root@localhost ffmpeg]# cd a52dec-0.7.4 [root@localhost a52dec-0.7.4]# ./configure --enable-shared=PKGS && make && make install [root@localhost a52dec-0.7.4]# ldconfig 安装 faac [root@localhost ffmpeg]# yum install -y automake autoconf libtool [root@localhost ffmpeg]# tar -zxvf faac-1.28.tar.gz [root@localhost ffmpeg]# cd faac-1.28 [root@localhost faac-1.28]# vi ./common/mp4v2/mpeg4ip.h … :123 #ifdef __cplusplus extern "C" { #endif //char *strcasestr(const char *haystack, const char *needle); #ifdef __cplusplus } #endif [root@localhost faac-1.28]# ./bootstrap && ./configure && make && make install [root@localhost faac-1.28]# ldconfig 安装 faad2 [root@localhost ffmpeg]# tar -zxvf faad2-2.7.tar.gz [root@localhost ffmpeg]# cd faad2-2.7 [root@localhost faad2-2.7]# chmod 755 bootstrap [root@localhost faad2-2.7]# ./bootstrap && ./configure && make && make install [root@localhost faad2-2.7]# ldconfig 安装 vo-aacenc [root@localhost ffmpeg]# tar -zxvf vo-aacenc_0.1.3.orig.tar.gz [root@localhost ffmpeg]# cd vo-aacenc-0.1.3/ [root@localhost vo-aacenc-0.1.3]# ./configure [root@localhost vo-aacenc-0.1.3]# make && make install [root@localhost vo-aacenc-0.1.3]# ldconfig 3) 安装FFmpeg [root@localhost ffmpeg]# tar -zxvf ffmpeg-1.2.11.tar.gz [root@localhost ffmpeg]# cd ffmpeg-1.2.11 [root@localhost ffmpeg-1.2.11]# ./configure --enable-gpl --enable-version3 --enable-postproc --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-libvo-aacenc [root@localhost ffmpeg-1.2.11]# make && make install [root@localhost ffmpeg-1.2.11]# ldconfig [root@localhost ffmpeg-1.2.11]# cp /usr/local/bin/ffmpeg /usr/bin/ 4) 安装qt-faststart [root@localhost ffmpeg-1.2.11]# cd ffmpeg-1.2.11 [root@localhost ffmpeg-1.2.11]# make tools/qt-faststart [root@localhost ffmpeg-1.2.11]# cp -a tools/qt-faststart /usr/bin/ 5) 查看版本和转换测试 查看版本 [root@localhost software]# ffmpeg ffmpeg version 1.2.11 Copyright (c) 2000-2014 the FFmpeg developers built on Apr 21 2016 17:48:12 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16) configuration: --enable-gpl --enable-postproc --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac libavutil 52. 18.100 / 52. 18.100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 2.100 / 52. 2.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... 测试 [root@localhost software]# ffmpeg -i ./09.mp4 -y -acodec libmp3lame -ab 128 -ar 22050 -vcodec h264 -b 96k -r 25 ./01.flv … [root@localhost software]# ll total 32232 -rw-r--r--. 1 root root 4378561 Apr 21 17:56 01.flv -rw-r--r--. 1 root root 28609569 Apr 21 17:52 09.mp4 成功!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值