找回密码
 注册账户
查看: 1808|回复: 5

安装FFMPEG + FFmpeg-php For Xampp

[复制链接]
棋子 发表于 2008-10-19 07:28:40 | 显示全部楼层 |阅读模式
Step 1
第一步
Download Lampp for Linux:
下载lampp for linux
DL ( http://www.apachefriends.org/en/xampp-linux.html)
下载地址  http://www.apachefriends.org/en/xampp-linux.html
http://www.apachefriends.org/download.php?...x-1.6.5a.tar.gz ( get the
latest release! )

Save the lampp in your home directory
保存lampp 到你的/home
Start Linux Shell (Terminal) and use sodo or su for extracting lampp
开始ssh 并解压
  1. sodo tar xvfz xampp-linux-1.6.5a.tar.gz -C /opt
  2. 命令  sodo tar xvfz xampp-linux-1.6.5a.tar.gz -C /opt
复制代码
or
或者
  1. su
  2. tar xvfz xampp-linux-1.6.5a.tar.gz -C /opt
复制代码
(if you're loged in as system administrator, make sure u are in right
path
you can find out by typeing pwd . Firefox by default will saves filez
in Desktop
in terminal type "
  1. cd /home/ur_account_name/Desktop
复制代码
"

now lampp is extracted to
  1. /opt/lampp/
复制代码
----------------------------------------
now we need install second file:
  1. Lampp Development Package
复制代码
http://www.apachefriends.org/download.php?...l-1.6.5a.tar.gz
  1. Extract: tar xvfz xampp-linux-devel-1.6.5a.tar.gz -C /opt
复制代码
To start lampp , call this command in shell
  1. /opt/lampp/lampp start
复制代码
For change defualt ftp, mysql and lampp directory password:
in terminal type:
  1. /opt/lampp/lampp security
复制代码
Step 2

Download Packages:
Start Linux shell if you're closed it :)
( we will make a directory inside root home directory to download all
packages in one place)
mkdir ffmpeg

Login to ffmpeg folder by type:
1. ~/ffmpeg
2. cd /root/ffmpeg

( type pwd for conforming yur current location if you're unsure :) )

in terminal:

wget http://mafiascripts.net/ffmpeg/flvtool2-1.0.6.tgz
wget http://mafiascripts.net/ffmpeg/lame-3.97.tar.gz
wget http://mafiascripts.net/ffmpeg/essential-20071007.tar.bz2
wget http://mafiascripts.net/ffmpeg/MPlayer-1.0rc1.tar.bz2
wget http://mafiascripts.net/ffmpeg/libogg-1.1.3.tar.gz
wget http://mafiascripts.net/ffmpeg/libvorbis-1.1.2.tar.gz
wget http://mafiascripts.net/ffmpeg/ffmpeg_source.tar.gz
wget http://mafiascripts.net/ffmpeg/ffmpeg-php-0.5.1.tbz2
wget http://mafiascripts.net/ffmpeg/amrnb-6.1.0.4.tar.bz2
wget http://mafiascripts.net/ffmpeg/libpng-1.2.18.tar.bz2
wget http://mspedia.com/ffmpeg/libjpeg-6b.tar.bz2
wget http://mafiascripts.net/ffmpeg/zlib-1.2.3.tar.bz2
wget http://mafiascripts.net/ffmpeg/libwmf-0.2.8.3.tar.gz
wget http://mafiascripts.net/ffmpeg/freetype-2.3.5.tar.bz2
wget http://mafiascripts.net/ffmpeg/gd-2.0.35.tar.bz2
wget http://mafiascripts.net/ffmpeg/ImageMagick-6.3.5-5.tar.bz2

Now we need to install them one by one but before we starting, you
need to
install following packages by inserting your linux CD or DVD in CD/DVD
drive and start package manager

install:

gcc
gcc++
libgcc
libgcc42
autoconf
automake
libtool
ruby
ruby-devel

ScSh:



Now we are ready to install packages:
Note: we're now loged in /ffmpeg folder ( cd /root/ffmpeg/)
#############Install FreeType##########
Step 1 Extract freetype ( for all packages follow this steps )
tar -xvjf freetype-2.3.5.tar.bz2

Step 2 Login to folder that contain extracted files

cd /root/ffmpeg/freetype-*
Step 3 call configure command by type:
./configure
Step 4 wait until called command finish its job then call make by
type:
make
Step 5 wait until called command finish its job then call make install
by type:
make install

############Install Zlib#########
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvjf zlib-1.2.3.tar.bz2
cd zlib*
./configure
make
make install
#########Install LibPNG###########

Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvjf libpng-1.2.18.tar.bz2
cd libpng-*
./configure
make
make install

##########Install LibJPEG##############
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvjf libjpeg-6b.tar.bz2
cd libjpeg-*
./configure
make
make install

###############Install LibWMF###################
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvzf libwmf-0.2.8.3.tar.gz
cd libwmf-0.2.8.3/
./configure
make
make install

##############Install GD###############
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvjf gd-2.0.35.tar.bz2
cd gd-2.0.35/
./configure --with-png=/usr/local/lib/ --with-jpeg=/usr/local/lib/
make
make install

############Install ImageMagick############
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvjf ImageMagick-6.3.5-5.tar.bz2
cd ImageMagick-6.3.5/
./configure
make
make install
###########Install FLVtool2############
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -zxvf flvtool2-1.0.6.tgz
cd flvtool2-*/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
ln -s /usr/bin/flvtool2 /usr/local/bin/flvtool2

Note:ln -s makes symbolic link (Shortcut in windows)
######################LAME##############################
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -zxvf lame-3.97.tar.gz
cd lame-3.97
./configure --enable-mp3x --enable-mp3rtp
make
make install

#################LibOGG#################
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvzf libogg-1.1.3.tar.gz
cd libogg-*
./configure
make
make install
##################Install AMRnb##############
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvjf amrnb-6.1.0.4.tar.bz2
cd amrnb-6.1.0.4/
./configure
make
make install
#################Install Essential#####################
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvjf essential-20071007.tar.bz2
chown -R root.root essential-20071007.tar.bz2
mkdir -pv /usr/local/lib/codecs/
cp -vrf essential-20071007/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

###Note: chown (change ownership) CP (copy) chmod (changemod)
###################Install LibVorbis####################
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvzf libvorbis-1.1.2.tar.gz
cd libvorbis-1.1.2
./configure
make
make install
##################Install MPlayer###################
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -jvxf MPlayer-1.0rc1.tar.bz2
cd MPlayer-1.0rc1/
./configure --with-codecsdir=/usr/local/lib/codecs/ --with-freetype-
config=/usr/include/freetype
make
make install
cp -vrf etc/codecs.conf /usr/local/etc/mplayer/
make clean

ln -s usr/local/bin/mplayer /usr/bin/mplayer
ln -s /usr/local/bin/mencoder /usr/bin/mencoder
#######################Install FFMPEG###################
Now back to ffmpeg folder ( cd /root/ffmpeg )

tar -xvzf ffmpeg_source.tar.gz
cd ffmpeg_source
tar xzf ffmpeg.tar.gz
cd ffmpeg/
./configure --enable-mp3lame --enable-shared --enable-libogg --enable-
vorbis --enable-amr_nb --enable-amr_wb --enable-amr_if2
make
make install
ln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg
/usr/bin/ffmpeg -v

###############REConfig Mplayer############
Now back to ffmpeg folder ( cd /root/ffmpeg )
cd MPlayer-1.0rc1/
./configure --with-codecsdir=/usr/local/lib/codecs/ --with-freetype-
config=/usr/include/freetype
make
make install
cp -vrf etc/codecs.conf /usr/local/etc/mplayer/
make clean
ln -s usr/local/bin/mplayer /usr/bin/mplayer
ln -s /usr/local/bin/mencoder /usr/bin/mencoder

###################Install FFMPEG-PHP#######################
tar -jxvf ffmpeg-php-0.5.1.tbz2
cd ffmpeg-php-*
/opt/lampp/bin/phpize
./configure --enable-shared --with-php-config=/opt/lampp/bin/php-
config --with-ffmpeg=/usr/local/bin/ffmpeg
make
make install
#################### END of installation ##################
now you need to open up your php.ini and add ffmpeg.so
if you have Gnome desktop simply call php.ini by call following
command

gedit /opt/lampp/etc/php.ini

or manully open it up. it's in /opt/lampp/etc/ folder
between line 516 - 527 add:

extension="ffmpeg.so"

line 386 add:
;extension_dir = /opt/lampp/lib/php/extensions/no-debug-non-
zts-20060613/

now should look like this:
; Directory in which the loadable extensions (modules) reside.
;extension_dir = /opt/lampp/lib/php/extensions/no-debug-non-
zts-20020429/
;extension_dir = /opt/lampp/lib/php/extensions/no-debug-non-
zts-20040412/
;extension_dir = /opt/lampp/lib/php/extensions/no-debug-non-
zts-20060613/

#if you have plan to use mail() function, you need to configure
sendmail too
#line 566 should look like this:( make sure you have installed
sendmail)
#in shell (terminal) write: whereis sendmail
#for call documentation call: man sendmail

; For Unix only. You may supply arguments as well (default: "sendmail -
t -i").
sendmail_path = /usr/sbin/sendmail -t
sendmail_from = [email protected]

change this valuse (read script installation document)
; Maximum allowed size for uploaded files. line 426
upload_max_filesize = 400M

; Maximum size of POST data that PHP will accept. line 332
post_max_size = 400M

max_execution_time = 8000 ; Maximum execution time of each script, in
seconds line 201
memory_limit = 100M ; Maximum amount of memory a script may consume
(8MB) line 202

; a value for this directive (e.g., output_buffering=4096). line 88
output_buffering = On

; After this number of seconds, stored data will be seen as 'garbage'
and
; cleaned up by the garbage collection process. line 788
session.gc_maxlifetime = 40000

Save changes and open up httpd.conf located in /opt/lampp/etc/

line 186
# First, we configure the "default" to be a very restrictive set of
# features.
#

Options FollowSymLinks
AllowOverride None
#XAMPP
#Order deny,allow
#Deny from all


Change it ot
# First, we configure the "default" to be a very restrictive set of
# features.
#

Options FollowSymLinks
AllowOverride All
#XAMPP
#Order deny,allow
#Deny from all


Line 334
ScriptAlias /cgi-bin/ "/opt/lampp/cgi-bin/"
change it to

ScriptAlias /cgi-bin/ "/opt/lampp/htdocs/cgi-bin/"

Line 350


AllowOverride None
Options None
Order allow,deny
Allow from all

change it to

AllowOverride None
Options ExecCGI -MultiViews +SymLinksifOwnerMatch
Order allow,deny
Allow from all


Save changes and restart apache by call:

/opt/lampp/lampp restartapache

Now you have php5 configured with FFMPEG-PHP , yur server will support
ostube, clipshare phpmotion and etc..
FFmpeg-php Google Groups:
http://groups.google.com/group/ffmpeg-php
咬咬 发表于 2008-10-19 09:16:54 | 显示全部楼层
抢占第一帖第一个沙发:)tounge_q
ghily86 发表于 2008-10-19 11:33:22 | 显示全部楼层
很好 很强大!!
sean0407 发表于 2008-12-9 16:11:50 | 显示全部楼层
好複雜!研究一下
hkbnp 发表于 2009-1-23 16:31:01 | 显示全部楼层
什么内容呢,看看
您需要登录后才可以回帖 登录 | 注册账户

本版积分规则

存档|黑屋|手机|网络实验室 本站服务器由美国合租以及IDCLayer国际数据提供!!!

GMT+8, 2026-6-9 14:13 , Processed in 0.011644 second(s), 8 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表