1
Here is a great resource for compiling ffmpeg.
3
http://vexxhost.com/blog/2007/03/03/installing-ffmpeg-ffmpeg-php-mplayer-mencoder-flv2tool-lame-mp3-encoder-libogg-%e2%80%93-the-easy-way/
5
Note I have attached an archive of this resource below. I am not the author of this content.
7
A lot of people are getting hiring people to install FFMPEG as they think it’s a difficult task, but it’s much easier than you think if you follow these instructions. You should have root access & basic Linux knowledge to the server to follow these instructions.
8
1. Create a directory to do our work in
13
2. Get all the source files
15
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/ essential-20061022.tar.bz2
16
wget http://rubyforge.org/frs/download.php/9225/ flvtool2_1.0.5_rc6.tgz
17
wget http://easynews.dl.sourceforge.net/sourceforge/ lame/lame-3.97.tar.gz
18
wget http://superb-west.dl.sourceforge.net/sourceforge/ ffmpeg-php/ffmpeg-php-0.5.0.tbz2
19
wget http://downloads.xiph.org/releases/ ogg/libogg-1.1.3.tar.gz
20
wget http://downloads.xiph.org/releases/ vorbis/libvorbis-1.1.2.tar.gz
22
3. Extract all the source files
24
bunzip2 essential-20061022.tar.bz2; tar xvf essential-20061022.tar
25
tar zxvf flvtool2_1.0.5_rc6.tgz
26
tar zxvf lame-3.97.tar.gz
27
bunzip2 ffmpeg-php-0.5.0.tbz2; tar xvf ffmpeg-php-0.5.0.tar
28
tar zxvf libogg-1.1.3.tar.gz
29
tar zxvf libvorbis-1.1.2.tar.gz
31
4. Create the codecs directory & import them
33
mkdir /usr/local/lib/codecs/
34
mv essential-20061022/* /usr/local/lib/codecs/
35
chmod -R 755 /usr/local/lib/codecs/
37
5. Install SVN/Ruby (Depends on OS, this is for RHEL/CentOS)
39
yum install subversion
41
yum install ncurses-devel
43
6. Get the latest FFMPEG/MPlayer from the subversion
45
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
46
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
57
cd ~/ffmpeg/libogg-1.1.3
64
cd ~/ffmpeg/libvorbis-1.1.2
71
cd ~/ffmpeg/flvtool2_1.0.5_rc6
86
./configure --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared
87
echo '#define HAVE_LRINTF 1' >> config.h
91
13. Finalize the codec setups
93
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
94
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
95
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
96
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
97
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
98
14. Compile FFMPEG-PHP
99
cd ~/ffmpeg/ ffmpeg-php-0.5.0
105
15. Install FFMPEG-PHP (make sure the php.ini path is correct.)
107
echo 'extension=/usr/local/lib/php/extensions/ no-debug-non-zts-20020429/ffmpeg.so' >> /usr/local/Zend/etc/php.ini
109
16. Restart Apache to load FFMPEG-PHP (Depends on OS, this is for RHEL/CentOS)
111
service httpd restart
113
17. Verify if it works
115
php -r 'phpinfo();' | grep ffmpeg
116
If you get a few lines such as
118
ffmpeg support (ffmpeg-php) => enabled
119
ffmpeg-php version => 0.5.0
120
ffmpeg.allow_persistent => 0 => 0
121
Then everything is installed and working. FFMPEG, FFMPEG-PHP, MPlayer, MEncoder, flv2tool, LAME MP3 encoder & libOGG.
127
NOTE: Please note this is not written by me the original author is Lunar.
131
One-stop Installation Guide for Create a Linux Server-side FLV
132
conversion environment <http://luar.com.hk/blog/?p=669>
134
Posted by luar under Flash Media Server <http://luar.com.hk/blog/?cat=32>
136
If you want to convert other video format to FLV (sorenson codec),
137
everybody will suggest using FFmpeg. In fact, only FFmpeg is not enough
138
for successfully create a server-side command line conversion
139
environment to create FLV with video and audio, plus the FLV 1.1
140
metadata information. I have stroked for a whole day to setup my Linux
141
server (Fedora Core 3), so I wrote down my note here for other people
142
and myself as a reference.
144
Purely install FFmpeg is not enough, the FLV converted has no audio,
145
because FLV audio codec is mp3, so you need LAME support. Moreover, the
146
FLV converted has no metadata, you cannot know the dimension, duration
147
such important information for a FLV player swf. Therefore, you need
148
another free tool: FLVTool2, which is written in Ruby, so I have to
149
install Ruby in my server, too.
151
Overall installation order: LAME->FFmpeg->Ruby->FLVTool2, if you want to
152
acess video info through FFmpeg in php, you can install ffmpeg-php, too.
154
Please login as root first:
157
Download from LAME site <http://lame.sourceforge.net/>, type the
158
following command to compile and install it:
160
./configure --enable-shared --prefix=/usr
164
enable-shared to make sure FFmpeg can use LAME later. Type /lame/ in
165
command line to see help after install succeed.
167
*Note*: you can also use /yum/ to install FFmpeg, it will install
168
dependency LAME, too, so you can skip this step.
173
Download from FFmpeg site <http://ffmpeg.sourceforge.net/> through CVS,
174
type the following command to get the latest copies from CVS and save to
175
your $home (currenly path after login into consule) with folder name
178
cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg
180
To compile and install it, type the following command:
182
./configure --enable-gpl --enable-mp3lame --enable-shared --prefix=/usr
186
enable-shared to make sure ffmpeg-php can use FFmpeg later (if you do
187
not use ffmpeg-php, you do not need --enable-shared --prefix=/usr). Type
188
/ffmpeg/ in command line to see help after install succeed.
190
*Note*: you can also use /yum/ to install FFmpeg:
195
Download from Ruby site <http://www.ruby-lang.org/en/>, type the
196
following command to compile and install it:
203
Download from FLVTool2 site <http://www.inlet-media.de/flvtool2>, type
204
the following command to compile and install it:
208
sudo ruby setup.rb install
210
Type /flvtool2/ in command line to see help after install succeed.
212
------------------------------------------------------------------------
214
Installation is completed here. If you want to access video infomation
215
easily in php, there is a ffmpeg-php
216
<http://ffmpeg-php.sourceforge.net/> you can try. You can follow the
217
instruction inside the package to install it. I installed it as a Shared
218
Extension and did not edit php.ini to add
222
When I try its test_phpvideotoolkit.php to verfiy the installation. I saw an error:
224
Unable to load dynamic library './ffmpeg.so' - ./ffmpeg.so: cannot open
225
shared object file: No such file or directory
227
You have to copy ffmpeg.so to your php extension folder, or like me, I
228
just copy the file to the same folder of the php script is located.
232
* FFmpeg usage command <http://luar.com.hk/blog/?p=670>
236
* FFMpeg compiled Windows exe
237
<http://ffdshow.faireal.net/mirror/ffmpeg/>
238
* Video and Audio Streaming with Flash and Open Source Tools
239
<http://klaus.geekserver.net/flash/streaming.html>
240
* libflv - creating FLV video streams
241
<http://klaus.geekserver.net/libflv/>
242
* FLV2MP3 <http://etudiant.epita.fr/~founad_m/flv2mp3/> (Make
243
FlashCom recorded FLV conversion possible ?!)
244
* Flash 视频(FLV)编码,转换,录制,播放方案一网打尽
245
<http://dengjie.com/weblog/comments.asp?post_id=1096>
247
<http://kyle.jolin.info/tt/index.php?pl=333&ct1=1>
248
* How To: Convert audio to another format on a web page
249
<http://www.gadberry.com/aaron/2005/12/16/how-to-convert-audio-to-another-format-from-a-form-on-a-web-page/>
250
(with installation guide, php code sample)