FFmpeg杞歡鍙槸涓В鐮佺紪鐮佽蔣浠訛紝濡傛灉鏀寔澶氱鏍煎紡蹇呴』鍏堝畨瑁呭ソ瀵瑰簲鐨勫簱錛屼笅闈㈠氨璇翠笅鎴戣鐨勫簱錛?br />
1. 瀹夎f(xié)aad2
# wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz
# tar xvfz faad2-2.6.1.tar.gz
# cd faad2
# ./bootstrap
# ./configure
# make
# make install
2. 瀹夎liba52
# wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
# tar xvfz a52dec-0.7.4.tar.gz
# cd a52dec-0.7.4
# ./configure
# make
# make install
3. 瀹夎libdirac
# wget http://downloads.sourceforge.net/dirac/dirac-0.10.0.tar.gz
# tar xvfz dirac-0.10.0.tar.gz
# cd dirac-0.10.0
# ./configure
# make
# make install
4. 瀹夎f(xié)aac2
# wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz
# tar xvfz faac-1.26.tar.gz
# cd faac
# ./bootstrap
# ./configure
# make
# make install
5. 瀹夎libamrnb
# wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2
# tar xvfj amrnb-7.0.0.2.tar.bz2
# cd amrnb-7.0.0.2
# ./configure
# make
# make install
6. 瀹夎libamrwb
# wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2
# tar xvfj amrwb-7.0.0.3.tar.bz2
# cd amrwb-7.0.0.3
# ./configure
# make
# make install
7. 瀹夎libmp3lame
# wget http://downloads.sourceforge.net/lame/lame-3.97.tar.gz
# tar xzf lame-3.97.tar.gz
# cd lame-3.97
# ./configure
# make
# make install
8. 瀹夎libx264
姝よ蔣浠跺寘闇瑕佺敤git鏉ヨ幏鍙栵紝鎵浠ヨ鍏堝畨瑁単it:
# wget http://kernel.org/pub/software/scm/git/git-1.6.2.tar.gz (鍦板潃瑕佺‘璁?
# tar zxvf git-1.6.2.tar.gz
# cd git-1.6.2
# ./configure
# make
# make install
鐒跺悗瀹夎libx264
# /usr/local/bin/git clone git://git.videolan.org/x264.git x264
# cd x264
# ./configure --enable-pthread --enable-shared --disable-asm
# make
# make install
8. 瀹夎libnut錛岃杞歡闇瑕佺敤svn鑾峰彇婧愪唬鐮侊紝svn鍙互鐩存帴鐢▂um install svn鏉ヨ銆傚厛涓嬭澆:
# svn co svn://svn.mplayerhq.hu/nut/src/trunk libnut
涓嬭澆鍚庝唬鐮佷繚瀛樺湪鏂板緩绔嬬殑libnut鐩綍涓嬶紝瀵逛簬64浣峀inux闇瑕佷慨鏀歸厤緗枃浠?
# cd libnut
# vi config.mak
鍦ㄦ渶鍚庝竴涓狢FLAGS涓嬩竴琛屽鍔?
CFLAGS += -fPIC
鐒跺悗緙栬瘧瀹夎:
# make
# make install
9. 瀹夎libogg
# wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
# tar xvf libogg-1.1.3.tar.gz
# cd libogg-1.1.3
# ./configure
# make
# make install
10. 瀹夎libtheora (svn鑾峰彇)
# svn co http://svn.xiph.org/trunk/theora theora
# cd theora
# ./autogen.sh
# ./configure
# make
# make install
11. 瀹夎libvorbis
# wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
# tar xvfz libvorbis-1.2.0.tar.gz
# cd libvorbis-1.2.0
# ./configure
# make
# make install
12. 瀹夎libxvid
# wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
# tar xvf xvidcore-1.2.1.tar.gz
# cd xvidcore-1.2.1/build/generic
# ./bootstrap.sh
# ./configure --disable-assembly
# make
# make install
涓婇潰鐨勫獟浣撴敮鎸佸簱瀹夎瀹屽悗錛屽彲浠ヨ緗笅鐜鍑嗗緙栬瘧FFmpeg浜?jiǎn)锛?br />
13. 淇敼鐜鍙橀噺
# vi /etc/ld.so.conf
鍦ㄦ枃浠舵湯澧炲姞涓琛?
/usr/local/lib
鐒跺悗鐢熸晥涔?
# ldconfig
14. 瀹夎FFmpeg
鍙互閫氳繃svn鑾峰彇錛屼笉榪囨枃浠舵瘮杈冨ぇ錛屾墍浠ョ壒鍒參:
# svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
# cd ffmpeg
涔熷彲浠ヨ嚜宸變笅杞?
# http://www.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
緙栬瘧(64浣嶇郴緇熼渶瑕佽緗?span style="font-size: 13px; ">PKG_CONFIG_PATH鍙傛暟):
# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig CFLAGS="-fPIC -m64"
# ./configure --enable-shared \
--enable-gpl \
--enable-nonfree \
--enable-postproc \
--enable-avfilter \
--enable-avfilter-lavf \
--enable-pthreads \
--enable-libamr-nb \
--enable-libamr-wb \
--enable-libdirac \
--enable-libfaac \
--enable-libfaad \
--enable-libfaadbin \
--enable-libmp3lame \
--enable-libnut \
--enable-libtheora \
--enable-libvorbis \
--enable-libx264 \
--enable-libxvid \
--enable-decoder=libx264 \
--enable-encoder=libx264
# make
# make install
14. 鍙兘鍑虹幇鐨勯敊璇?
/usr/include/linux/videodev.h:56: error: syntax error before "ulong"
/usr/include/linux/videodev.h:72: error: syntax error before '}' token
libavdevice/v4l.c: In function `grab_read_header':
libavdevice/v4l.c:75: error: storage size of 'tuner' isn't known
libavdevice/v4l.c:133: error: invalid application of `sizeof' to incomplete type `video_tuner'
libavdevice/v4l.c:140: error: invalid application of `sizeof' to incomplete type `video_tuner'
libavdevice/v4l.c:75: warning: unused variable `tuner'
榪欏彲鑳芥槸婧愪唬鐮乿ideodev.h涓嶆槸閽堝嬈$増鏈琇inux鍐欑殑錛屾爣鍑咰娌℃湁ulong綾誨瀷錛屾墍浠ヨ鏀規(guī)垚unsigned long
15. 榪愯ffmpeg -formats錛屽彲鑳藉嚭鐨勯敊璇?
ffmpeg: error while loading shared libraries: libavfilter.so.0: cannot open shared object file: No such file or directory
榪欎簨娌℃湁璁劇疆鐜璺緞閫犳垚浜?jiǎn)锛屽鍔犱竴涓猣fmpeg.conf閰嶇疆鏂囦歡:
# cd /etc/ld.so.conf.d
# vi ffmpeg.conf
鍦ㄦ枃浠跺唴鍐欎笂:
/usr/local/lib
鐒跺悗紜鐢熸晥:
# ldconfig
16. 鍏朵粬:
鏈枃涓病鏈夋彁鍒發(fā)ibgsm鐨勫畨瑁咃紝璇峰弬鑰冧笅闈㈢殑璧勬枡銆?br />
鍙傝冭祫鏂?
64bit鐗圠inux銇с伄ffmpeg銇挵澧冩綃夛紙for CentOS5.3錛?/a>

]]>