forked from tony2001/ffmpeg-php
-
Notifications
You must be signed in to change notification settings - Fork 2
/
INSTALL
133 lines (84 loc) · 3.89 KB
/
INSTALL
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
REQUIREMENTS
============
ffmpeg-0.5.0 or higher built with the --enable-shared option
php-5.0.x or higher. For php-4, use ffmpeg-php-0.5.1 or older.
gd-2.0.x or higher or the version of GD bundled with PHP
INSTALLATION INSTRUCTIONS
=========================
These instructions are for Linux/Unix. Windows is not offically supported at this time however,
there are user-contributed builds that will run on window. Search the sourceforge downloads page
for these.
INSTALLING FROM A PACKAGE MANAGER
---------------------------------
There are prebuilt packages for many Linux distros.
Gentoo:
emerge ffmpeg-php
Debian/Ubuntu:
apt-get install php5-ffmpeg
Other:
check your docs for specific info on how to invoke the package manager.
BUILDING FFMPEG
---------------
cd /path/to/ffmpeg
./configure --enable-shared --prefix=/usr
make clean && make
[become root]
make install
BUILDING FFMPEG-PHP AS A SHARED EXTENSION
-----------------------------------------
1. Build php if not already built or installed by your distro (See the file INSTALL in your php source directory)
2. Unpack the archive
tar -xjf ffmpeg-php.X.x.x.tbz2 -C /path/to/php_sources/ext/
3. cd into the ffmpeg extension directory
cd /path/to/php_sources/ext/ffmpeg-php.X.X.X/
4. Run phpize (included with your php install) to build configuration files
phpize
5. Configure and build
./configure && make
6. Install the shared extension
make install (as root)
If everything went as planned, ffmpeg-php is now installed as a shared library.
You must explicitly load it in your scripts using dl(ffmpeg.so) or if you want
it available to all scripts by default add extension=ffmpeg.so to your php.ini
file which will tell php to load it when starting up.
BUILDING FFMPEG-PHP AS PART OF THE PHP BINARY
---------------------------------------------
1. Unpack the archive and copy the ffmpeg extension directory into your the php
sources extensions directory
tar -xjf ffmpeg-php.X.x.x.tbz2 -C /path/to/php_sources/ext/
2. Run autoconf to rebuild the php configure script and add the --with-ffmpeg
option
cd /path/to/php_sources
autoconf
2. configure php using...
./configure --with-ffmpeg=yes
...and build and install php.
The ffmpeg-php methods should now be built directly into php and so no need to
explicitly load the extension at runtime.
TESTING THE INSTALLATION
------------------------
1. Put the directory test_media and test_ffmpeg.php script under your web root
somewhere (put both in the same directory).
2. Load test_ffmpeg.php into your browser.
RESULTS: You should get a listing of the methods provided by the ffmpeg-php
module as well as some test output from the methods.
TROUBLESHOOTING
---------------
Q: I get '`gdImage' undeclared or `gdImagePtr''undeclared when I try to
build ffmpeg-php
A: Your version of php is compiled without gd support. Make sure to use the
'--with-gd' flag when configuring php. If you're sure you have gd but
it is not being detected, reconfigure the build with
'--enable-skip-gd-check' to force ffmpeg-php to build with gd support.
Q: I get 'avcodec.h: No such file or directory' when I try to 'make' ffmpeg-php
A: ffmpeg-php can't find ffmpeg header files. Make sure when you configure
ffmpeg you use the '--enable-shared' option and make sure it installs
somewhere where other programs can find the libs/headers. See
'BUILDING FFMPEG' above for an example.
Q: Can I just pay you to install it?
A: Yes. I will install ffmpeg + codecs, ffmpeg-php and flvtool2 on your server for $75 USD. This
is everything you need to convert just about any movie type to flash.
Shoot me an email at ffmpeg.php AT gmail.com if you are interested.
FURTHER HELP
------------
If you get stuck, post a message to the ffmpeg-php google group (http://groups-beta.google.com/group/ffmpeg-php)