通过svn下载:从客户端程序。先装subversion,确保已经安装了apr和apr-util,在apache.org网站能下到wget=/usr/local/apr-httpd--with-apr-util=/usr/local/apr-util-httpd/make;makeinstall到此,我们就可以通过svn命令获取最新的ffmpeg了svncheckoutsvn://svn.mplayerhq.hu/ffmpeg/trunkffmpeg你会发现在你所在的目录,自动出现一个ffmpeg的目录,就是你下载的源代码。我们还不能这么快编译ffmpeg,应该如果要让ffmpeg支持更多格式的转换,还需做一些前期工作2.支持mp3,linux当然是lame,下载解压cdlame-3.96.1./configure--enable-shared--prefix=/usrmake;makeinstall这里推荐尽量装在/usr下,默认是装在/usr/local下。这样ffmpeg编译都能顺利的找到库文件3.支持OggVorbis:as4自带相应的rpm包,你可以安装一下如下rpm包libvorbis,libvorbis-devel,libogg,libogg-devel4.支持xvidx264,现在最流行的两种高质量的压缩格式xvid的编译安装wget=/usrmake;makeinstallx264的获取同样是采用svn方式svncosvn://svn.videolan.org/x264/trunkx264cdx264./configure--prefix=/usr--enable-sharedmake;makeinstall5.AC3和dts编码的支持as4系统似乎已经支持ac3编码,编译的时候只要加--enable-a52--enable-gpl参数就行libdts编译参数./configure--prefix=/usrmake;makeinstall6.mpg4aac格式支持,由于服务器还针对手机用户服务,所以,类似aac,mpg4铃声格式的支持,我们也得做。这里我们安装faad2和faac就行下载请到的编译cdfaad2autoreconf-vif./configure--prefix=/usr--with-mp4v2--enable-sharedmake;makeinstallfaac的编译cdfaacchmod+xbootstrap./bootstrap./configure--prefix=/usr--with-mp4v2--enable-sharedmake;makeinstall7.支持3gp格式,这也是现在好多手机支持的格式,因为手机用户是我们的主要用户,所以也得支持编译编译的时候加上--enable-amr_nb--enable-amr_wb参数就行,根据编译系统的提示,所以我们得下载一些编译3gp所需得文件。wget解压以后把里面的文件都拷贝到libavcodec/amrwb_floatwget解压以后把里面的文件都拷贝到libavcodec/amr_float好了,基本ffmpeg支持的格式,我们基本都做好前期准备了,下面是ffmpeg的编译./configure--prefix=/usr--enable-gpl--enable-shared--enable-mp3lame--enable-amr_nb--enable-amr_wb--enable-amr_if2--enable-libogg--enable-vorbis--enable-xvid--enable-a52--enable-a52bin--enable-faadbin--enable-dts--enable-pp--enable-faad--enable-faac--enable-x264--enable-pthreads--disable-ffserver--disable-ffplaymake;makeinstall具体查看./configure-help补充1:关于3gp的编译,如果大家要编译--enable-amr_nb-fixed,那就不能跟--enable-amr_nb同时编译,我不大清楚这两者到底有什么区别,似乎fixed是修正版,管他呢,编译的方法:wget解压以后把里面的文件都拷贝到libavcodec/amr目录下修改libavcodec/amr/makefile找到CFLAGS=-Wall-pedantic-errors-I.$(CFLAGS_$(MODE))-D$(VAD)换成CFLAGS=-Wall-I.$(CFLAGS_$(MODE))-D$(VAD)-DMMS_IO整体编译参数就是./configure--prefix=/usr--enable-gpl--enable-shared--enable-mp3lame--enable-amr_nb-fixed--enable-amr_wb--enable-amr_if2--enable-libogg--enable-vorbis--enable-xvid--enable-a52--enable-a52bin--enable-dts--enable-pp--enable-faad--enable-faadbin--enable-faac--enable-x264--enable-pthreads--disable-ffserver--disable-ffplaymakemakeinstall补充2:有朋友说在当在cpu是x86的情况下,不能编译过去,我这里没发生过这情况,如果你真编译不过去,可以试着加上cpu=cpu补充3:对于rm、wmv可以用wmplayer提供的Mencoder来处理下面的是运行./configure相关配置打印出的信息:installprefix/usr/localsourcepath/mnt/192.168.81.152/ffmpeg_related/source_svnCcompilergcc.alignispower-of-twonoARCHx86(generic)big-endiannoyasmnoMMXenabledyesMMX2enabledyes3DNow!enabledyes3DNow!extendedenabledyesSSEenabledyesSSSE3enabledyesCMOVenabledyesCMOVisfastyesEBXavailableyesEBPavailableyes10operandssupportedyesgprofenablednodebugsymbolsyesstripsymbolsyesoptimizationsyesstaticyessharedyespostprocessingsupportnosoftwarescalerenablednonewfiltersupportnofiltersusinglavformatnovideohookingyesImlib2supportnoFreeTypesupportyesnetworksupportyesIPv6supportyesthreadingsupportnoSDLsupportyesSunmedialibsupportnoAVISynthenablednolibamr-nbsupportnolibamr-wbsupportnolibdc1394supportnolibdiracenablednolibfaacenablednolibfaadenablednolibfaaddlopenednolibgsmenablednolibmp3lameenablednolibnutenablednolibopenjpegenablednolibschroedingerenablednolibspeexenablednolibtheoraenablednolibvorbisenablednolibx264enablednolibxvidenablednovdpauenablednozlibenabledyesbzlibenabledyesEnableddecoders:aacflashsvpcm_u16leaascflicpcm_u24beadpcm_4xmflvpcm_u24leadpcm_adxfourxmpcm_u32beadpcm_ctfrapspcm_u32leadpcm_eagifpcm_u8adpcm_ea_maxis_xah261pcm_zorkadpcm_ea_r1h263pcxadpcm_ea_r2h263ipngadpcm_ea_r3h264ptxadpcm_ea_xashuffyuvqcelpadpcm_g726idcinqdm2adpcm_ima_amvimcqdrawadpcm_ima_dk3indeo2qpegadpcm_ima_dk4indeo3qtrleadpcm_ima_ea_eacsinterplay_dpcmra_144adpcm_ima_ea_seadinterplay_videora_288adpcm_ima_issjpeglsrawvideoadpcm_ima_qtkmvcrl2adpcm_ima_smjpeglocoroqadpcm_ima_wavmace3roq_dpcmadpcm_ima_wsmace6rpzaadpcm_msmdecrv10adpcm_sbpro_2mimicrv20adpcm_sbpro_3mjpegrv30adpcm_sbpro_4mjpegbrv40adpcm_swfmlpsgiadpcm_thpmmvideoshortenadpcm_xamotionpixelssmackaudadpcm_yamahamp1smackeralacmp2smcamvmp3snowapemp3adusol_dpcmasv1mp3on4sonicasv2mpc7sp5xatrac3mpc8sunrastavsmpeg1videosvq1bethsoftvidmpeg2videosvq3bfimpeg4targabmpmpeg_xvmctheorac93mpegvideothpcavsmsmpeg4v1tiertexseqvideocinepakmsmpeg4v2tiffcljrmsmpeg4v3truemotion1cookmsrletruemotion2cscdmsvideo1truespeechcyuvmszhtsccdcanellymoserttadnxhdnuvtxddsicinaudiopcm_alawultidsicinvideopcm_dvdvbdvbsubpcm_f32bevc1dvdsubpcm_f32levcr1dv