FFmpeg linux下標准安裝 及 web使用。

參考網上的資料,終於搞好了。記錄一下

1,下載LAME(Lame Aint an MP3 Encoder)
http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309
我下載的是:lame-3.97.tar.gz

2,下載xvidcore
http://downloads.xvid.org/downloads/xvidcore-1.1.3.tar.gz
我下載的是:xvidcore-1.1.3.tar.gz

3,ogg vorbis,這個一般redhat有,可以到/usr/lib/libvorbis.a在不在。如果不在,安裝它。
支持Ogg Vorbis:
as4自带相应的rpm包,你可以安装一下如下rpm包
libvorbis, libvorbis-devel,libogg, libogg-devel

http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz

 

4,下載X264
官網:http://x264.nl/
http://www.videolan.org/developers/x264.html
去它的FTP上下載。

5,下載libdts
http://down1.chinaunix.net/distfiles/libdts-0.0.2.tar.gz

http://download.videolan.org/pub/videolan/libdca/0.0.2/libdca-0.0.2.tar.gz

6,下載a52dec
http://liba52.sourceforge.net/

7,下載FAAD2 和FAAC
http://www.audiocoding.com/downloads.html

 

開始安裝那些codec
1,安裝lame
tar -zxvf lame-3.97.tar.gz
cd lame-3.97
./configure --enable-shared --prefix=/usr
make
make install

安裝支持Ogg Vorbis:
as4自带相应的rpm包,你可以安装一下如下rpm包
libvorbis, libvorbis-devel,libogg, libogg-devel

http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
./configure --prefix=/usr
make
make install

 

2,安裝xvid
tar zvxf xvidcore-1.1.3.tar.gz
cd xvidcore-1.1.3/build/generic
./configure --prefix=/usr
make
make install

3,安裝x264
bunzip2 x264-snapshot-20070913-2245.tar.bz2
tar xvf x264-snapshot-20070913-2245.tar
./configure --prefix=/usr --enable-shared
make
make install

4,5.AC3和dts编码的支持
安裝libdts
#mv libdts-0.0.2.tar.tar libdts-0.0.2.tar.gz
tar zxvf libdts-0.0.2.tar.gz
cd libdts-0.0.2
./configure --prefix=/usr
make
make install

安裝a52


5,安裝mpg4 aac格式支持
安裝faad2

tar xvf faad2-2.5.tar.gz

faad2的2.5版本需要修改内置的configure.in文件,不然会在没有libbmp时编译会通不过.找到configure.in中下面一段:

引用
if test x$WITHBMP = xyes; then
 AC_DEFINE([HAVE_BMP], 1, [User wants beep media player plugin built])
 AM_CONDITIONAL([HAVE_XMMS], true)
 AM_CONDITIONAL([HAVE_BMP], true)
fi

if test x$WITHDRM = xyes; then
 改成
if test x$WITHBMP = xyes; then
 AC_DEFINE([HAVE_BMP], 1, [User wants beep media player plugin built])
 AM_CONDITIONAL([HAVE_XMMS], true)
 AM_CONDITIONAL([HAVE_BMP], true)
else
 AC_MSG_NOTICE(no bmp build configured)
 AM_CONDITIONAL([HAVE_BMP], false)
fi

if test x$WITHDRM = xyes; then

FAAD2的编译
cd faad2

echo > plugins/Makefile.am                        
echo > plugins/xmms/src/Makefile.am
sed -i '/E_B/d' configure.in


autoreconf -vif
./configure --prefix=/usr --with-mp4v2 --enable-shared
make
make install

 


安裝faac
tar zxvf faac-1.25.tar.gz
cd faac
sed -i '/[2de].M/d' configure.in
echo "AC_OUTPUT(common/Makefile common/mp4v2/Makefile libfaac/Makefile frontend/Makefile include/Makefile Makefile)" >> configure.in
autoreconf -vif
./configure --prefix=/usr
make &&
make install

 

6,安裝3gp
先解壓ffmpeg,然後把下面解壓到ffmpeg的目錄下。

wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip
解压以后把里面的文件都拷贝到libavcodec/amrwb_float

wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip
解压以后把里面的文件都拷贝到libavcodec/amr_float


7,安裝ffmpeg

[root@localhost ffmpeg-checkout-2007-09-13]# ./configure --prefix=/usr --enable-gpl --enable-shared --enable-libmp3lame --enable-libogg --enable-libvorbis

--enable-libamr-nb --enable-libamr-wb --enable-libxvid --enable-libx264 --enable-liba52 --enable-liba52bin --enable-libfaac --enable-libfaad -

-enable-libfaadbin --enable-pp --enable-pthreads --disable-ffserver --disable-ffplay
ERROR: liba52 not found
If you think configure made a mistake, make sure you are using the latest
version from SVN.  If the latest version fails, report the problem to the
ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.

 

需下載liba52
下載地址:
http://liba52.sourceforge.net/


[root@localhost ffmpeg-checkout-2007-09-13]# ./configure --prefix=/usr --enable-gpl --enable-shared --enable-libmp3lame --enable-libogg --enable-libvorbis

--enable-libamr-nb --enable-libamr-wb --enable-libxvid --enable-libx264 --enable-liba52 --enable-liba52bin --enable-libfaac --enable-libfaad -

-enable-libfaadbin --enable-pp --enable-pthreads --disable-ffserver --disable-ffplay
ERROR: libamrnb not found
If you think configure made a mistake, make sure you are using the latest
version from SVN.  If the latest version fails, report the problem to the
ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.

 


下载一个新的amr-nb,amr-wb包,是库文件,不是源码.
amr-wb:http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.1.tar.bz2
amr-nb:http://ftp.penguin.cz/pub/users/utx/amr/amrnb-6.1.0.4.tar.bz2
然后 configure make make install 就可以了.

終於成功了。

ffmpeg -i test.mpg -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 test.flv

ffmpeg -an -y -t 0:0:0.001 -i test.flv -f image2 test.jpg

 

ffmpeg的中文wiki:http://www.ffmpeg.com.cn/index.php/Ffmpeg%E5%BF%AB%E9%80%9F%E5%AE%89%E8%A3%85
ffmpeg在linux下java調用:http://hi.baidu.com/injava/blog/item/04580c4cbb32b1f9d72afcbb.html 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值