~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to api/lib/phpvideotoolkit/INSTALL

Preparing to merge in my branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Here is a great resource for compiling ffmpeg.
 
2
 
 
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/
 
4
 
 
5
Note I have attached an archive of this resource below. I am not the author of this content.
 
6
 
 
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
 
9
 
 
10
mkdir ~/ffmpeg
 
11
cd ~/ffmpeg
 
12
 
 
13
2. Get all the source files
 
14
 
 
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
 
21
 
 
22
3. Extract all the source files
 
23
 
 
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
 
30
 
 
31
4. Create the codecs directory & import them
 
32
 
 
33
mkdir /usr/local/lib/codecs/
 
34
mv essential-20061022/* /usr/local/lib/codecs/
 
35
chmod -R 755 /usr/local/lib/codecs/
 
36
 
 
37
5. Install SVN/Ruby (Depends on OS, this is for RHEL/CentOS)
 
38
 
 
39
yum install subversion
 
40
yum install ruby
 
41
yum install ncurses-devel
 
42
 
 
43
6. Get the latest FFMPEG/MPlayer from the subversion
 
44
 
 
45
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
 
46
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
 
47
 
 
48
7. Compile LAME
 
49
 
 
50
cd ~/ffmpeg/lame-3.97
 
51
./configure
 
52
make
 
53
make install
 
54
 
 
55
8. Compile libOGG
 
56
 
 
57
cd ~/ffmpeg/libogg-1.1.3
 
58
./configure
 
59
make
 
60
make install
 
61
 
 
62
9. Compile libVorbis
 
63
 
 
64
cd ~/ffmpeg/libvorbis-1.1.2
 
65
./configure
 
66
make
 
67
make install
 
68
 
 
69
10. Compile flvtool2
 
70
 
 
71
cd ~/ffmpeg/flvtool2_1.0.5_rc6
 
72
ruby setup.rb config
 
73
ruby setup.rb setup
 
74
ruby setup.rb install
 
75
 
 
76
11. Compile MPlayer
 
77
 
 
78
cd ~/ffmpeg/mplayer
 
79
./configure
 
80
make
 
81
make install
 
82
 
 
83
12. Compile FFMPEG
 
84
 
 
85
cd ~/ffmpeg/ffmpeg
 
86
./configure --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared
 
87
echo '#define HAVE_LRINTF 1' >> config.h
 
88
make
 
89
make install
 
90
 
 
91
13. Finalize the codec setups
 
92
 
 
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
 
100
phpize
 
101
./configure
 
102
make
 
103
make install
 
104
 
 
105
15. Install FFMPEG-PHP (make sure the php.ini path is correct.)
 
106
 
 
107
echo 'extension=/usr/local/lib/php/extensions/ no-debug-non-zts-20020429/ffmpeg.so' >> /usr/local/Zend/etc/php.ini
 
108
 
 
109
16. Restart Apache to load FFMPEG-PHP (Depends on OS, this is for RHEL/CentOS)
 
110
 
 
111
service httpd restart
 
112
 
 
113
17. Verify if it works
 
114
 
 
115
php -r 'phpinfo();' | grep ffmpeg
 
116
If you get a few lines such as
 
117
ffmpeg
 
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.
 
122
 
 
123
 
 
124
 
 
125
---------------
 
126
 
 
127
NOTE: Please note this is not written by me the original author is Lunar.
 
128
 
 
129
Wed 19 Apr 2006
 
130
 
 
131
One-stop Installation Guide for Create a Linux Server-side FLV
 
132
conversion environment <http://luar.com.hk/blog/?p=669>
 
133
 
 
134
Posted by luar under Flash Media Server <http://luar.com.hk/blog/?cat=32>
 
135
 
 
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.
 
143
 
 
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.
 
150
 
 
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.
 
153
 
 
154
Please login as root first:
 
155
 
 
156
*Install LAME*
 
157
Download from LAME site <http://lame.sourceforge.net/>, type the
 
158
following command to compile and install it:
 
159
 
 
160
./configure --enable-shared --prefix=/usr
 
161
make
 
162
make install
 
163
 
 
164
enable-shared to make sure FFmpeg can use LAME later. Type /lame/ in
 
165
command line to see help after install succeed.
 
166
 
 
167
*Note*: you can also use /yum/ to install FFmpeg, it will install
 
168
dependency LAME, too, so you can skip this step.
 
169
 
 
170
yum install ffmpeg
 
171
 
 
172
*Install FFmpeg*
 
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
 
176
"ffmpeg":
 
177
 
 
178
cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg
 
179
 
 
180
To compile and install it, type the following command:
 
181
 
 
182
./configure --enable-gpl --enable-mp3lame --enable-shared --prefix=/usr
 
183
make clean && make
 
184
make install
 
185
 
 
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.
 
189
 
 
190
*Note*: you can also use /yum/ to install FFmpeg:
 
191
 
 
192
yum install ffmpeg
 
193
 
 
194
*Install Ruby*
 
195
Download from Ruby site <http://www.ruby-lang.org/en/>, type the
 
196
following command to compile and install it:
 
197
 
 
198
./configure
 
199
make
 
200
make install
 
201
 
 
202
*Install FLVTool2*
 
203
Download from FLVTool2 site <http://www.inlet-media.de/flvtool2>, type
 
204
the following command to compile and install it:
 
205
 
 
206
ruby setup.rb config
 
207
ruby setup.rb setup
 
208
sudo ruby setup.rb install
 
209
 
 
210
Type /flvtool2/ in command line to see help after install succeed.
 
211
 
 
212
------------------------------------------------------------------------
 
213
 
 
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
 
219
 
 
220
extension=ffmpeg.so
 
221
 
 
222
When I try its test_phpvideotoolkit.php to verfiy the installation. I saw an error:
 
223
 
 
224
Unable to load dynamic library './ffmpeg.so' - ./ffmpeg.so: cannot open
 
225
shared object file: No such file or directory
 
226
 
 
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.
 
229
 
 
230
_Follow up_
 
231
 
 
232
    * FFmpeg usage command <http://luar.com.hk/blog/?p=670>
 
233
 
 
234
_Other Reference_
 
235
 
 
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>
 
246
    * 幾套各種影片轉FLV影音檔工具
 
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)
 
251
 
 
252
/* SVN FILE: $Id$ */