Ubuntu 9.10下安装和使用ffmpeg的详细过程!

希望高手帮忙,小弟做毕业设计,为了这个头都大了,试了好多网上的方法都不行,请哪位大哥细心帮忙,小弟不胜感激!
在Ubuntu9.10下: 安装和使用ffmpeg的详细过程!不是装Ubuntu!

ffmpeg的编译、安装及使用(for x86,for arm)
http://hi.baidu.com/iminway/blog/item/bda2db4e29ced701b2de05f1.html

最新的ffmpeg可以通过svn下载,SVN辅助的软件有:
SubVersion,从 http://subversion.tigris.org/ 下载,支持linux。
TortoiseSVN,从 http://tortoisesvn.tigris.org/ 下载,是很不错的SVN客户端程序,为windows外壳程序集成到windows资源管理器和文件管理系统的Subversion客户端,用起来很方便。

http://subversion.tigris.org/downloads/subversion-1.3.2.tar.gz
tar zvxf subversion-1.3.2.tar.gz
cd subversion-1.3.2
./configure --with-apr=/usr/local/apr-httpd --with-apr-util=/usr/local/apr-util-httpd/
make
make install
如果安装了FC6,它已经带了svn,不用装了。
ffmpeg的下载:我们就可以通过svn命令获取最新的ffmpeg,命令如下:
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

xvid的获取地址如下:
http://www.xvid.org/
wget http://downloads.xvid.org/downloads/xvidcore-1.1.3.tar.gz
配置编译
for x86
#./configure --prefix=/usr/local
#make
#make install
for arm
#CC=arm-linux-gcc ./configure --prefix=/usr/local/arm/arm-linux --build=i686-pc-linux --host=arm-linux --target=arm-linux
#make
#make install

x264的获取地址如下:
svn co svn://svn.videolan.org/x264/trunk x264
配置编译
for x86
#./configure --enable-shared --prefix=/usr/local
#make
#make install
for arm
#CC=arm-linux-gcc ./configure --enable-pthread --enable-shared --host=arm-linux

#make install

lame的获取地址如下: http://lame.sourceforge.net/index.php
配置编译
for x86
./configure --enable-shared --prefix=/usr/local

libdts编译参数
./configure --prefix=/usr
make
make install

http://www.audiocoding.com/modules/mydownloads/http://prdownloads.sourceforge.net/faac
FAAD2的编译
cd faad2
autoreconf -vif
./configure --prefix=/usr --with-mp4v2 --enable-shared
make
make install
faac的编译
cd faac
chmod +x bootstrap
./bootstrap
./configure --prefix=/usr --with-mp4v2 --enable-shared
make
make install
在编译ffmpeg,在configure时加上--enable-amr_nb --enable-faad --enable-faac参数。

编译的时候加上--enable-amr_nb --enable-amr_wb参数就行,根据编译系统的提示,所以我们得下载一些编译3gp所需得文件。
源码网址:http://www.3gpp.org/ftp/Specs
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

微软ASF格式的三个版本,WMV1,WMV2,WMV3分别对应MediaPlayer的版本7,8和9,所以很多时候会称VC1为WMV3或 WMV9,都是它了,有时候在代码里,也能看到称呼它为VC9的。因为微软还没有正式公开这种格式,所以当前对VC1的支持还很不完善。本文基本是根据 Multimedia Mike的一篇博客翻译和完善而来。
(1) 首先要下载 SMPTE VC-1 reference decoder,这个组织是要收费的,可以从这里下载免费的。
(2) 在ffmpeg目录下的libavcodec目录下面,建立目录libvc1。
(3) 将VC1_reference_decoder_release6/decoder/目录中的*.c和*.h文件全部copy到libvc1目录下。
(4) 将VC1_reference_decoder_release6/shared/目录中的*.c和*.h文件全部copy到libvc1目录下。
(5) 将 libvc1-makefile.txt放到libvc1下的Makefile文件。
(6) 将smpte-vc1.c文件放到libavcodec目录下。
(7) 修改libavcodec目录下的vc9.c,将文件最后的wmv3_decoder这个AVCodec的structure,用#if 0和#endif包含起来,也就是使它失效了。
(8) 修改libavcodec目录下的allcodecs.c,将register_avcodec(&wmv3_decoder)上下的注释去掉,使它发挥作用。
(9) 修改libavcodec目录下的Makefile,把OBJS的列表中加入smpte-vc1.o。
(10)修改ffmpeg主目录下的Makefile文件,把-L./libavcodec/libvc1 -lvc1$(BUILDSUF)加入到FFLIBS后面。
(11) 进入ffmpeg/libavcodec/libav1,执行make
(12) 到ffmpeg主目录下,执行config;make;make install。config时根据实际情况带参数。

采用ffmpeg转码制作FLV文件,和转码成其它媒体类型的重要差别是一定要有lame库支持,因为FLV的声音编码采用mp3格式,非lame这个东 东不行。编译ffmpeg中加入lame库真是一场灾难,特别在windows下,很多参数都不能发挥作用,最后直接手工copy和改一些文件,记录如 下:
(1) 如果在Windows下编译,第一步当然是下载MinGW和MSYS来装上了。到http://mingw.sourceforge.net/去下载最新版的MinGW-5.0.2.exe和MSYS-1.0.11-2004.04.30-1.exe。
(2) 先安装MinGW,直接运行MinGW-5.0.2.exe安装,选择目录,譬如选择D:\MinGW为安装目录。安装时需要选择gcc和make模块,安装文件本身很小,会从网上下载模块来安装。
(3) 然后安装MSYS,也是直接运行MSYS-1.0.11-2004.04.30-1.exe安装。安装目录一般选择D:\MinGW\bin \1.0。,安装过程会询问刚才安装MinGW的目录,输入D:\MinGW,其它都回答'Y'就搞定了。如果不清楚,可以看这个图片效果。
(4) 运行MSYS,桌面上有个图标,双击就运行了,运行结果是一个模拟unix的命令窗口,后面的编译都在这种状态下进行。前面4步在linux不需要。
(5) 到http://lame.sourceforge.net/去下载最新版的lame-3.97b2.tar.gz,copy到你认为合适的地方,解压后进入lame解压出来的目录中。执行
./configure --prefix=PREFIX
make
make install
(6) 就把编译出来的include下的lame目录copy到/usr/include目录下,把lib下的几个库文件都copy到/usr/lib目录 下。这里注意有个变化,如果只copy lib目录下的静态库到/usr/lib下,就是只copy libmp3lame.a文件,编译出来的ffmpeg最终就不会对libmp3lame的动态库有依赖关系,这是因为编译首先找动态库,动态库没有才找 静态库。如果不做这个copy,后面编译ffmpeg时无论如何指定参数,都会报错LAME not found,不知道是哪里的bug。
(7) 从http://ffmpeg.mplayerhq.hu/取得最新的ffmpeg,现在自由软件都大量采用SVN了,要先装一个SVN,可以去http://tortoisesvn.tigris.org/下载windows版的SVN,去http://subversion.tigris.org/下载linux版的SVN。SVN如何编译安装这里就省略了。
(8) 如果在windows下,打开解压后的ffmpeg目录下的Makefile文件,在FFLIBS的那一行后面加上-lmp3lame$(BUILDSUF)。这个也不知道是哪个bug引起的,搞了好长时间才搞出来,郁闷。Linux下不用这样。

#./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-ffplay
make
make install

http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip
解压以后把里面的文件都拷贝到libavcodec/amr目录下

make
make install

#./configure --prefix=./install --disable-shared --enable-pthreads --enable-libx264 --enable-libxvid --arch=i686 --enable-gpl
#make
#make install

配置编译
#./configure --prefix=/home/zht/redhatzht/sources/image-colletct/ffmpeg/install --enable-static --disable-shared --enable-libx264 --enable-libxvid --cross-compile --cc=arm-linux-gcc --arch=arm --enable-gpl --disable-strip --disable-network --disable-ipv6 --disable-vhook --disable-audio-beos --disable-audio-oss --disable-mpegaudio-hp --enable-pthreads --enable-small --disable-parsers --disable-debug
#make
#make install

x86上的ldconfig不能在arm上运行,arm上的ldconfig工具是在建立交叉编译器时,编译glibc是产生的,可以拷贝到arm-linux中。
(4) 本文大部分内容来自网络,其中xvid,x264的库,我亲手安装过,ffmpeg的配置编译for x86的简易配置,for arm,我亲手配置编译过,并在x86,arm上可用,编译配置都是采用静态库。

ffmpeg作为媒体文件处理软件,基本用法如下:
ffmpeg -i INPUTfile [OPTI

文章出处:DIY部落(http://www.diybl.com/course/6_system/linux/Linuxjs/20091024/180077.html)
温馨提示:答案为网友推荐,仅供参考
第1个回答  2010-01-26
库里有。 去ubuntu论坛的学习一下。

库里的确有。

安装方法就是:打开新立得软件包管理器。搜索ffmpeg ,找到后安装就是了。
也可使用终端命令:sudo apt-get install ffmpeg
没联网的话还可以下载ffmpeg的deb包安装。非常简单。

安装完成如何使用:请用man ffmpeg查看帮助。
部分内容如下:

FFMPEG(1) FFMPEG(1)

NAME
ffmpeg - FFmpeg video converter

SYNOPSIS
ffmpeg [[infile options][-i infile]]... {[outfile options] outfile}...

DESCRIPTION
As a general rule, options are applied to the next specified file. Therefore, order is important, and you can have the same option on the command
line multiple times. Each occurrence is then applied to the next input or output file.

* To set the video bitrate of the output file to 64kbit/s:

ffmpeg -i input.avi -b 64k output.avi

* To force the frame rate of the output file to 24 fps:

ffmpeg -i input.avi -r 24 output.avi

* To force the frame rate of the input file (valid for raw formats only) to 1 fps and the frame rate of the output file to 24 fps:

ffmpeg -r 1 -i input.m2v -r 24 output.avi

The format option may be needed for raw input files.

By default, FFmpeg tries to convert as losslessly as possible: It uses the same audio and video parameters for the outputs as the one specified
for the inputs.

OPTIONS
Main options
-L Show license.

-h Show help.

-version
Show version.

Manual page ffmpeg(1) line 1
第2个回答  2010-01-29
这个应该是个解码器吧》
直接下载安装就好了sudo apt-get install ffmpeg 前提是联网。
第3个回答  2010-01-25
我现在用arch,删了ubuntu,找不到具体名(apt-get)出来...

ubuntu的就到ubuntu社区论坛去吧(ubuntu.org.cn),建议不要到ylmf论坛, 不会对你有帮助的...