FFmpeg 加入 faac及faad2 库

 

环境:RedHat as 4 (gcc:3.4.6)

FFmpeg软件只是个解码编码软件,如果支持多种格式必须先安装好对应的库,下面就说说装库:

由于gcc版本低下载的FaacFaad2版本不能是最新的。到网上下载faac-1.24.tar.gzfaad2-2.0.tar.gz

1.      Faac

#wget ftp://ftp.uni-frankfurt.de/pub/Mirrors2/gentoo.org/distfiles/faac-1.24.tar.gz

# tar xvfz faac-1.24.tar.gz
# cd faac

#chmod 777 bootstrap
# ./bootstrap
# ./configure
# make
# make install

2.      Faad2

IE下载:http://download.chinaunix.net/down.php?id=5363&ResourceID=2885&site=1

# tar xvfz faad2-2.0.tar.gz

# cd faad2

#chmod 777 bootstrap
# ./bootstrap
# ./configure

(make以前把faad2主目录下的Makefile修改下,找到有“rpm:    Makefile”的一行,把它下面三行前面的所有空格都改成一个TAB,否则,编译会报错)
# make
# make install

3.      FFmpeg

#wget http://ffmpeg.org/releases/ffmpeg-0.5.tar.bz2

# bzip2 -d ffmpeg-0.5.tar.bz2
# tar -xf ffmpeg-0.5.tar
# cd ffmpeg-0.5

# ./configure --enable-shared "
--enable-gpl "
-enable-libfaac "

--enable-libfaad "

--enable-libfaadbin

# make

(可能出现的错误:

/usr/include/linux/videodev.h:55: error: syntax error before "ulong"

/usr/include/linux/videodev.h:71: error: syntax error before '}' token

libavdevice/v4l.c: In function `grab_read_header':

libavdevice/v4l.c:77: error: storage size of 'tuner' isn't known

libavdevice/v4l.c:141: error: invalid application of `sizeof' to incomplete type `video_tuner'

libavdevice/v4l.c:148: error: invalid application of `sizeof' to incomplete type `video_tuner'

libavdevice/v4l.c:77: warning: unused variable `tuner'

make: *** [libavdevice/v4l.o] 错误 1

vi /usr/include/linux/videodev.h

查找rangelow, rangehigh;      /* Tuner range */这一行

 ulong rangelow, rangehigh;      /* Tuner range */

改为:

     unsigned long rangelow, rangehigh;      /* Tuner range */

这可能是源代码videodev.h不是针对次版本Linux写的,标准C没有ulong类型,所以要改成unsigned long

)
# make install

4.      运行 ffmpeg

成功看到:configuration: --enable-gpl --enable-shared --enable-libfaac --enable-libfaad --enable-libfaadbin

说明faacfaad2 已加入到了ffmpeg

可能出的错误:

ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

解决办法:

vi /etc/ld.so.conf

加入:/usr/local/lib

执行ldconfig

5.      音源转换命令:

采样率 -ar 44100

声道 -ac 1/2

码率/比特率 -ab 32k/218k  

编码率:-acodec (AAc格式:libfaac)

ffmpeg  –i  2.mp3  -ac 2  -ab  114k -acodec libfaac 2.aac(90比特率)

ffmpeg -i  2.mp3  -ac 2  -ab  78k -acodec libfaac 2.aac(64比特率)

Other Error - bitrate parameter is set too low :
This is probably with relation to the audio bitrate. -ab 56 sets the audio bitrate to 56 bits per second. Try either -ab 56k or -ab 56000 for 56 kbps.


在CentOS-4.4 x86_64安装FFmpeg (非原创)
http://203.208.37.132/search?q=cache:yTBG0mMuwYwJ:www.blogjava.net/javaren/archive/2009/09/22/279800.html+%E5%A6%82%E4%BD%95+%E5%AE%89%E8%A3%85ffmpeg-0.5.tar.bz2&cd=1&hl=zh-CN&ct=clnk&gl=cn&st_usg=ALhdy29u1loEbJVSqgsOVEBLjoHxf0Cezg

你可能感兴趣的:(FFmpeg 加入 faac及faad2 库)