转载自:http://my.oschina.net/ethan09/blog/372435?fromerr=zURtthw0
1. 首先安装系统编译环境
1
|
yum
install
-y automake autoconf libtool
gcc
gcc
-c++
#CentOS
|
2. 编译所需源码包
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#yasm:汇编器,新版本的ffmpeg增加了汇编代码
wget http:
//www
.tortall.net
/projects/yasm/releases/yasm-1
.3.0.
tar
.gz
tar
-xzvf yasm-1.3.0.
tar
.gz
cd
yasm-1.3.0
.
/configure
make
make
install
#lame:Mp3音频解码
wget http:
//jaist
.dl.sourceforge.net
/project/lame/lame/3
.99
/lame-3
.99.5.
tar
.gz
tar
-xzvf lame-3.99.5.
tar
.gz
cd
lame-3.99.5
.
/configure
make
make
install
#amr支持
wget http:
//downloads
.sourceforge.net
/project/opencore-amr/opencore-amr/opencore-amr-0
.1.3.
tar
.gz
tar
-xzvf opencore-amr-0.1.3.
tar
.gz
cd
opencore-amr-0.1.3
.
/configure
make
make
install
#amrnb支持
wget http:
//www
.penguin.cz/~utx
/ftp/amr/amrnb-11
.0.0.0.
tar
.bz2
tar
-xjvf amrnb-11.0.0.0.
tar
.bz2
cd
amrnb-11.0.0.0
.
/configure
make
make
install
#amrwb支持
wget http:
//www
.penguin.cz/~utx
/ftp/amr/amrwb-11
.0.0.0.
tar
.bz2
tar
-xjvf amrwb-11.0.0.0.
tar
.bz2
cd
amrwb-11.0.0.0
.
/configure
make
make
install
#ffmpeg
wget http:
//ffmpeg
.org
/releases/ffmpeg-2
.5.3.
tar
.bz2
tar
-xjvf ffmpeg-2.5.3.
tar
.bz2
cd
ffmpeg-2.5.3
.
/configure
--
enable
-libmp3lame --
enable
-libopencore-amrnb --
enable
-libopencore-amrwb --
enable
-version3 --
enable
-shared
make
make
install
#加载配置
vi /etc/ld.so.conf
在文件末尾加上:/usr/local/lib
如:
[root@localhost aaa]# more /etc/ld.so.conf
include ld.so.conf.d/*.conf /usr/local/lib 执行命令:ldconfig
#最后写入config后,终端运行ffmpeg命令,出现success和已安装的扩展,则运行成功。
执行ffmpeg
|
3.使用方法
1
2
|
ffmpeg -i 1.mp3 -ac 1 -ar 8000 1.amr
#MP3转换AMR
ffmpeg -i 1.amr 1.mp3
#AMR转换MP3
|