Linux 安装FFmpeg安装配置

来源:互联网 发布:人工智能发展现状 编辑:程序博客网 时间:2024/05/16 12:56
一、FFMEPG安装前的支持软件包
1、lame   支持mp3
Url:http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309
#####################################
tar -zxvf lame-398.tar.gz   
cd lame-398  
./configure --enable-shared --prefix=/usr   
make && make install
#####################################
 
2、libogg 
Url:http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz 
###################################
tar xvfz libogg-1.1.3.tar.gz
cd libogg-1.1.3
./configure --prefix=/usr   
make && make install
###################################
 
3、libvorbis 
Url:http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz 
#####################################
tar xvfz libvorbis-1.1.2.tar.gz
cd libvorbis-1.1.2
./configure --prefix=/usr   
make && make install
#####################################
 
4、xvid   高质量的压缩格式
Url:http://downloads.xvid.org/downloads/xvidcore-1.1.3.tar.gz 
#####################################
tar zvxf xvidcore-1.1.3.tar.gz   
cd xvidcore-1.1.3/build/generic   
./configure --prefix=/usr   
make && make install
#####################################

(补充)安裝 yasm 彙編器 yasm-0.6.0.tar.gz 
# cd /usr/local/src/video
# wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.1.tar.gz
# tar xzvf yasm-0.7.1.tar.gz
# cd yasm-0.7.1
# ./configure --prefix=/usr/local/yasm
# make && make install
export PATH='$PATH:/usr/local/yasm/bin'
#vi /etc/profile
export PATH='$PATH:/usr/local/yasm/bin'
#####################################
 
5、x264  高质量的压缩格式
x264-snapshot-20080401-2245.tar.bz2 (PS:最新包无法编译成功)
Url:http://www.videolan.org/developers/x264.html 
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/ 
#####################################
 tar xvfj x264-snapshot-20080401-2245.tar.bz2
cd x264-snapshot-20080401-2245  
./configure --prefix=/usr --enable-shared   
make && make install 
#####################################
 
支持AC3和DTS
6、libdts  dts编码的支持
http://download.videolan.org/pub/videolan/libdca/0.0.2/libdca-0.0.2.tar.gz 
#####################################
tar zxvf libdca-0.0.2.tar.gz   
cd libdts-0.0.2  
./configure --prefix=/usr   
make && make install
#####################################
 
7、a52 
a52dec-0.7.4.tar.gz 
http://liba52.sourceforge.net/downloads.html 
#####################################
tar xvfz a52dec-0.7.4.tar.gz
cd a52dec-0.7.4
./configure --prefix=/usr   
make && make install
#####################################

支持MPEG4和AAC
8、faad2 
faad2-2.6.1.tar.gz 
http://www.audiocoding.com/downloads.html 
#####################################
tar xvfz faad2-2.6.1.tar.gz 
cd faad2
autoreconf -vif   
./configure --prefix=/usr --with-mp4v2 --enable-shared   
make && make install  
#####################################
 
9、faac 
faac-1.26.tar.gz 
http://linux.softpedia.com/progDownload/FAAC-Download-554.html 
#####################################
tar zxvf faac-1.26.tar.gz   
cd faac   
./bootstrap   
./configure --prefix=/usr --with-mp4v2 --enable-shared  
make && make install 
#####################################

支持3gp格式
10、amr-nb
 
amrnb-6.1.0.4.tar.bz2 
http://ftp.penguin.cz/pub/users/utx/amr/amrnb-6.1.0.4.tar.bz2 
#####################################
tar xvfj amrnb-6.1.0.4.tar.bz2 
cd amrnb-6.1.0.4
./configure --prefix=/usr   
make && make install  
#####################################
 
11、amr-wb 
amrwb-7.0.0.1.tar.bz2 
http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.1.tar.bz2 
#####################################
tar xvfj amrwb-7.0.0.1.tar.bz2
cd amrwb-7.0.0.1
./configure --prefix=/usr   
make && make install 
#####################################
 
二、安装FFMEPG包

12、ffmpeg
******************************************************************
编译前将字段类型修改
vi /usr/include/linux/videodev.h
rangelow, rangehigh;      /* Tuner range */
把  ulong rangelow, rangehigh;      /* Tuner range */
改为:
     unsigned long rangelow, rangehigh;      /* Tuner range */
*******************************************************************
安装ffmpeg 
http://ffmpeg.mplayerhq.hu/ffmpeg-checkout-snapshot.tar.bz2
#####################################
tar xvfj ffmpeg-checkout-snapshot.tar.bz2 
cd ffmpeg-checkout-2008-09-01
./configure --prefix=/usr --enable-gpl --enable-shared --enable-libmp3lame  --enable-libvorbis --enable-libamr-nb --enable-libamr-wb --enable-libxvid --enable-libx264 --enable-liba52 --enable-liba52bin --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-pthreads --enable-nonfree --disable-ffserver --disable-ffplay   
make && make install

 
FAQ:error while loadingshared libraries:libavformat.so.51
ffmpeg出现这个错误是因为使用动态链接安装的找不到库,这个问题困扰了我好几天,最后终于在http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2006-December/005644.html发现了解决问题的方法,这个问题error while loadingshared libraries:libavformat.so.51是在执行ffmpeg时出现的,例如/usr/bin/ffmpeg -i /var/www/html/admin/upload/movie/20081016183115.3gp -y -ab 64 -ar 11025 -ac 2 -b 1500 -qscale 9 -r 15 -s 400*320 /var/www/html/test.flv
这段:
edit /etc/ld.so.conf and put the line
/usr/local/lib 
then save
(you may have a directory /etc/ld.so.conf.d
if so you can place a file with the same info there)
then run ldconfig -V as above
编辑ld.so.conf
vi /etc/ld.so.conf按INSERT进入编辑模式,在最后加入一行
/usr/local/lib
按ESC退出编辑模式,输入:wq确定后保存
运行ldconfig或者/sbin/ldconfig
ldconfig -V

#####################################
 
 
三、播放器(可选)
14、安装flvtool
[root@fc8 flvtool2_1.0.5_rc6]# yum install ruby
[root@fc8 flvtool2_1.0.5_rc6]# ruby setup.rb config
[root@fc8 flvtool2_1.0.5_rc6]# ruby setup.rb setup
[root@fc8 flvtool2_1.0.5_rc6]# ruby setup.rb install
##########################################################################################
安装mplayer
[root@fc8 ~]# mkdir -p /usr/local/lib/codes
[root@fc8 ~]# mkdir -p /usr/local/lib/win32codcs
[root@fc8 ~]# tar -jxvf essential-20071007.tar.bz2
[root@fc8 ~]# cp -rf essential-20071007/* /usr/local/lib/codes/
[root@fc8 ~]# tar -jxvf windows-essential-20071007.tar.bz2 
[root@fc8 software]# cp -rf windows-essential-20071007/* /usr/local/lib/win32codcs/
[root@fc8 ~]# tar -jxvf MPlayer-1.0rc2.tar.bz2 
[root@fc8 MPlayer-1.0rc2]# ./configure --prefix=/usr/local/mplayer --enable-freetype --codecsdir=/usr/local/lib/codes --win32codecsdir=/usr/local/lib/win32codcs
[root@fc8 MPlayer-1.0rc2]# make;make install
#########################################################################################
安装ffmpeg-php.X.XX.tar.gz
1. Unpack the archive
        tar -xjf ffmpeg-php.X.XX.tar.gz
2. cd into the ffmpeg extension directory
        cd ffmpeg-php.X.XX/
3. Run phpize (included with your php install) to build configuration files
        phpize
4. Configure and build
        ./configure --with-php-config=/opt/php/bin && make
5. Install the shared extension
        make install (as root)

参考 :http://blog.chinaunix.net/uid-790245-id-2037528.html
0 0