aboutsummaryrefslogtreecommitdiff
path: root/libraries/phpvideotoolkit/INSTALL.old
blob: 5875f1fd6837275d3ef406c904d0b25a1c644756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
Please note this information is now outdated. The automated ffmpeg install is recommended for installing ffmpeg et-al.

-------------

Here is a great resource for compiling ffmpeg.

http://vexxhost.com/blog/2007/03/03/installing-ffmpeg-ffmpeg-php-mplayer-mencoder-flv2tool-lame-mp3-encoder-libogg-%e2%80%93-the-easy-way/

Note I have attached an archive of this resource below. I am not the author of this content.

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.
1. Create a directory to do our work in

mkdir ~/ffmpeg
cd ~/ffmpeg

2. Get all the source files

wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.0.tbz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz

3. Extract all the source files

bunzip2 essential-20061022.tar.bz2; tar xvf essential-20061022.tar
tar zxvf flvtool2_1.0.5_rc6.tgz
tar zxvf lame-3.97.tar.gz
bunzip2 ffmpeg-php-0.5.0.tbz2; tar xvf ffmpeg-php-0.5.0.tar
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz

4. Create the codecs directory & import them

mkdir /usr/local/lib/codecs/
mv essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

5. Install SVN/Ruby (Depends on OS, this is for RHEL/CentOS)

yum install subversion
yum install ruby
yum install ncurses-devel

6. Get the latest FFMPEG/MPlayer from the subversion

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

7. Compile LAME

cd ~/ffmpeg/lame-3.97
./configure
make
make install

8. Compile libOGG

cd ~/ffmpeg/libogg-1.1.3
./configure
make
make install

9. Compile libVorbis

cd ~/ffmpeg/libvorbis-1.1.2
./configure
make
make install

10. Compile flvtool2

cd ~/ffmpeg/flvtool2_1.0.5_rc6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

11. Compile MPlayer

cd ~/ffmpeg/mplayer
./configure
make
make install

12. Compile FFMPEG

cd ~/ffmpeg/ffmpeg
./configure --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared
echo '#define HAVE_LRINTF 1' >> config.h
make
make install

13. Finalize the codec setups

ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
14. Compile FFMPEG-PHP
cd ~/ffmpeg/ ffmpeg-php-0.5.0
phpize
./configure
make
make install

15. Install FFMPEG-PHP (make sure the php.ini path is correct.)

echo 'extension=/usr/local/lib/php/extensions/ no-debug-non-zts-20020429/ffmpeg.so' >> /usr/local/Zend/etc/php.ini

16. Restart Apache to load FFMPEG-PHP (Depends on OS, this is for RHEL/CentOS)

service httpd restart

17. Verify if it works

php -r 'phpinfo();' | grep ffmpeg
If you get a few lines such as
ffmpeg
ffmpeg support (ffmpeg-php) => enabled
ffmpeg-php version => 0.5.0
ffmpeg.allow_persistent => 0 => 0
Then everything is installed and working. FFMPEG, FFMPEG-PHP, MPlayer, MEncoder, flv2tool, LAME MP3 encoder & libOGG.



---------------

NOTE: Please note this is not written by me the original author is Lunar.

Wed 19 Apr 2006

One-stop Installation Guide for Create a Linux Server-side FLV
conversion environment <http://luar.com.hk/blog/?p=669>

Posted by luar under Flash Media Server <http://luar.com.hk/blog/?cat=32>

If you want to convert other video format to FLV (sorenson codec),
everybody will suggest using FFmpeg. In fact, only FFmpeg is not enough
for successfully create a server-side command line conversion
environment to create FLV with video and audio, plus the FLV 1.1
metadata information. I have stroked for a whole day to setup my Linux
server (Fedora Core 3), so I wrote down my note here for other people
and myself as a reference.

Purely install FFmpeg is not enough, the FLV converted has no audio,
because FLV audio codec is mp3, so you need LAME support. Moreover, the
FLV converted has no metadata, you cannot know the dimension, duration
such important information for a FLV player swf. Therefore, you need
another free tool: FLVTool2, which is written in Ruby, so I have to
install Ruby in my server, too.

Overall installation order: LAME->FFmpeg->Ruby->FLVTool2, if you want to
acess video info through FFmpeg in php, you can install ffmpeg-php, too.

Please login as root first:

*Install LAME*
Download from LAME site <http://lame.sourceforge.net/>, type the
following command to compile and install it:

./configure --enable-shared --prefix=/usr
make
make install

enable-shared to make sure FFmpeg can use LAME later. Type /lame/ in
command line to see help after install succeed.

*Note*: you can also use /yum/ to install FFmpeg, it will install
dependency LAME, too, so you can skip this step.

yum install ffmpeg

*Install FFmpeg*
Download from FFmpeg site <http://ffmpeg.sourceforge.net/> through CVS,
type the following command to get the latest copies from CVS and save to
your $home (currenly path after login into consule) with folder name
"ffmpeg":

cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg
-or-
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg


To compile and install it, type the following command:

./configure --enable-gpl --enable-mp3lame --enable-shared --prefix=/usr
make clean && make
make install

enable-shared to make sure ffmpeg-php can use FFmpeg later (if you do
not use ffmpeg-php, you do not need --enable-shared --prefix=/usr). Type
/ffmpeg/ in command line to see help after install succeed.

*Note*: you can also use /yum/ to install FFmpeg:

yum install ffmpeg

*Install Ruby*
Download from Ruby site <http://www.ruby-lang.org/en/>, type the
following command to compile and install it:

./configure
make
make install

*Install FLVTool2*
Download from FLVTool2 site <http://www.inlet-media.de/flvtool2>, type
the following command to compile and install it:

ruby setup.rb config
ruby setup.rb setup
sudo ruby setup.rb install

Type /flvtool2/ in command line to see help after install succeed.

------------------------------------------------------------------------

Installation is completed here. If you want to access video infomation
easily in php, there is a ffmpeg-php
<http://ffmpeg-php.sourceforge.net/> you can try. You can follow the
instruction inside the package to install it. I installed it as a Shared
Extension and did not edit php.ini to add

extension=ffmpeg.so

When I try its test_phpvideotoolkit.php to verfiy the installation. I saw an error:

Unable to load dynamic library './ffmpeg.so' - ./ffmpeg.so: cannot open
shared object file: No such file or directory

You have to copy ffmpeg.so to your php extension folder, or like me, I
just copy the file to the same folder of the php script is located.

_Follow up_

    * FFmpeg usage command <http://luar.com.hk/blog/?p=670>

_Other Reference_

    * FFMpeg compiled Windows exe
      <http://ffdshow.faireal.net/mirror/ffmpeg/>
    * Video and Audio Streaming with Flash and Open Source Tools
      <http://klaus.geekserver.net/flash/streaming.html>
    * libflv - creating FLV video streams
      <http://klaus.geekserver.net/libflv/>
    * FLV2MP3 <http://etudiant.epita.fr/~founad_m/flv2mp3/> (Make
      FlashCom recorded FLV conversion possible ?!)
    * Flash ��Ƶ(FLV)����,ת��,¼��,���ŷ���һ����
      <http://dengjie.com/weblog/comments.asp?post_id=1096>
    * ���׸��NӰƬ�DFLVӰ���n����
      <http://kyle.jolin.info/tt/index.php?pl=333&ct1=1>
    * How To: Convert audio to another format on a web page
      <http://www.gadberry.com/aaron/2005/12/16/how-to-convert-audio-to-another-format-from-a-form-on-a-web-page/>
      (with installation guide, php code sample)