最近因为要在linux上用ffmpeg处理一些视频,所以在学习centos下要安装ffmpeg,但是能搜到的安装教程感觉都不是很好用,至少我用起来感觉特别不爽,而且在ffmpeg的指令使用上格式写错了,好吧,其实也与我完全没有linux的使用经验也有关系,不过写下这篇经历,希望能对以后要入门的同学有所助益!
首先,下载最新版的ffmpeg:http://www.ffmpeg.org/download.html
然后下载汇编优化器yasm:http://yasm.tortall.net/Download.html,因为是linux下使用,所以我们要下载的是source.tar.gz
然后就可以开始在linux上安装了!
用secureFX将资料传到centos中,然后输入一下指令:
# su,获得linux的root权限(如果你不是root的权限的话需要这个貌似)
用
# cd /ffmpeg
找到压缩包所在的文件夹
先解压yasm(以1.2.0版本为例):
# tar xvzf yasm-1.2.0.tar.gz
(注:linux下,gz的压缩文件解压用 xvzf指令,bz2格式的压缩文件用 jxvf指令解压)
解压之后输入:
# cd /ffmpeg/yasm-1.2.0
进入解压的文件夹,然后输入
# ./configure
确认文件是否都有,然后输入:
# make
编译软件,再输入
# make install
安装软件,你也可以直接输入
# make && make install
直接安装软件!
安装完之后,输入
# cd /ffmpeg
回到上级目录,然后输入
# tar jxvf ffmpeg-1.2.tar.bz2
# cd /ffmpeg/ffmpeg-1.2
# ./configure
# make && make install
安装完之后,输入
# ./ffmpeg --help
你可以看到ffmpeg怎么用,有哪些指令可以用!到此为止,ffmpeg就安装好了!