CentOS 6.3 x86_64にffmpeg-phpをインストールした時のメモ
ffmpeg-php
http://ffmpeg-php.sourceforge.net/
ffmpeg-php download
http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/
今回はffmpeg-php-0.6.0.tbz2を使いました
- 必要なパッケージのインストール
- ffmpeg-php-0.6.0.tbz2のダウンロード
- ffmpeg-php-0.6.0.tbz2を解凍
- コンパイル
- ffmpeg-phpインストール
- phpの設定
- php拡張モジュール確認
ffmpegの他に必要パッケージを事前にインストールします。ffmpegのインストールはこちら
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 |
[root@host1 src]# yum install php-devel re2c Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: ftp.iij.ad.jp * epel: mirror.nus.edu.sg * extras: ftp.iij.ad.jp * rpmforge: ftp.riken.jp * updates: ftp.iij.ad.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package php-devel.x86_64 0:5.3.3-14.el6_3 will be installed ---> Package re2c.x86_64 0:0.13.5-1.el6.rf will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: php-devel x86_64 5.3.3-14.el6_3 updates 506 k re2c x86_64 0.13.5-1.el6.rf rpmforge 210 k Transaction Summary ================================================================================ Install 2 Package(s) Total download size: 716 k Installed size: 3.7 M Is this ok [y/N]: y Downloading Packages: (1/2): php-devel-5.3.3-14.el6_3.x86_64.rpm | 506 kB 00:00 (2/2): re2c-0.13.5-1.el6.rf.x86_64.rpm | 210 kB 00:00 -------------------------------------------------------------------------------- Total 631 kB/s | 716 kB 00:01 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : php-devel-5.3.3-14.el6_3.x86_64 1/2 Installing : re2c-0.13.5-1.el6.rf.x86_64 2/2 Verifying : re2c-0.13.5-1.el6.rf.x86_64 1/2 Verifying : php-devel-5.3.3-14.el6_3.x86_64 2/2 Installed: php-devel.x86_64 0:5.3.3-14.el6_3 re2c.x86_64 0:0.13.5-1.el6.rf Complete! [root@host1 src]# yum install ffmpeg-libpostproc ffmpeg-devel Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: ftp.jaist.ac.jp * epel: ftp.jaist.ac.jp * extras: ftp.jaist.ac.jp * rpmforge: ftp.kddilabs.jp * updates: ftp.jaist.ac.jp Setting up Install Process Package ffmpeg-libpostproc-0.6.5-1.el6.rf.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package ffmpeg-devel.x86_64 0:0.6.5-1.el6.rf will be installed --> Processing Dependency: SDL-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: librtmp-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: schroedinger-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: lame-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: dirac-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: faad2-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: libogg-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: a52dec-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: gsm-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: opencore-amr-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: libdc1394-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: faac-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: libtheora-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: imlib2-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Processing Dependency: x264-devel for package: ffmpeg-devel-0.6.5-1.el6.rf.x86_64 --> Running transaction check ---> Package SDL-devel.x86_64 0:1.2.14-3.el6 will be installed ---> Package a52dec-devel.x86_64 0:0.7.4-8.el6.rf will be installed ---> Package dirac-devel.x86_64 0:1.0.2-4.el6 will be installed ---> Package faac-devel.x86_64 0:1.26-1.el6.rf will be installed ---> Package faad2-devel.x86_64 0:2.7-1.el6.rf will be installed --> Processing Dependency: faad2 = 2.7-1.el6.rf for package: faad2-devel-2.7-1.el6.rf.x86_64 --> Processing Dependency: libfaad.so.2()(64bit) for package: faad2-devel-2.7-1.el6.rf.x86_64 ---> Package gsm-devel.x86_64 0:1.0.13-4.el6 will be installed ---> Package imlib2-devel.x86_64 0:1.4.4-1.el6.rf will be installed --> Processing Dependency: imlib2 = 1.4.4 for package: imlib2-devel-1.4.4-1.el6.rf.x86_64 --> Processing Dependency: libImlib2.so.1()(64bit) for package: imlib2-devel-1.4.4-1.el6.rf.x86_64 ---> Package lame-devel.x86_64 0:3.99.5-1.el6.rf will be installed ---> Package libdc1394-devel.x86_64 0:2.1.2-3.4.el6 will be installed --> Processing Dependency: libraw1394-devel for package: libdc1394-devel-2.1.2-3.4.el6.x86_64 ---> Package libogg-devel.x86_64 2:1.1.4-2.1.el6 will be installed ---> Package librtmp-devel.x86_64 0:2.3-1.el6.rf will be installed ---> Package libtheora-devel.x86_64 1:1.1.0-2.el6 will be installed ---> Package opencore-amr-devel.x86_64 0:0.1.2-1.el6.rf will be installed ---> Package schroedinger-devel.x86_64 0:1.0.10-1.el6.rf will be installed --> Processing Dependency: liboil-devel >= 0.3.16 for package: schroedinger-devel-1.0.10-1.el6.rf.x86_64 --> Processing Dependency: pkgconfig(orc-0.4) >= 0.4.10 for package: schroedinger-devel-1.0.10-1.el6.rf.x86_64 ---> Package x264-devel.x86_64 0:0.0.0-0.4.20101111.el6.rf will be installed --> Running transaction check ---> Package faad2.x86_64 0:2.7-1.el6.rf will be installed ---> Package imlib2.x86_64 0:1.4.4-1.el6.rf will be installed ---> Package liboil-devel.x86_64 0:0.3.16-4.1.el6 will be installed ---> Package libraw1394-devel.x86_64 0:2.0.4-1.el6 will be installed ---> Package orc-devel.x86_64 0:0.4.16-6.el6 will be installed --> Processing Dependency: orc-compiler for package: orc-devel-0.4.16-6.el6.x86_64 --> Running transaction check ---> Package orc-compiler.x86_64 0:0.4.16-6.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: ffmpeg-devel x86_64 0.6.5-1.el6.rf rpmforge 2.9 M Installing for dependencies: SDL-devel x86_64 1.2.14-3.el6 base 362 k a52dec-devel x86_64 0.7.4-8.el6.rf rpmforge 28 k dirac-devel x86_64 1.0.2-4.el6 epel 16 k faac-devel x86_64 1.26-1.el6.rf rpmforge 5.7 k faad2 x86_64 2.7-1.el6.rf rpmforge 312 k faad2-devel x86_64 2.7-1.el6.rf rpmforge 9.4 k gsm-devel x86_64 1.0.13-4.el6 base 14 k imlib2 x86_64 1.4.4-1.el6.rf rpmforge 964 k imlib2-devel x86_64 1.4.4-1.el6.rf rpmforge 8.9 k lame-devel x86_64 3.99.5-1.el6.rf rpmforge 21 k libdc1394-devel x86_64 2.1.2-3.4.el6 base 50 k libogg-devel x86_64 2:1.1.4-2.1.el6 base 12 k liboil-devel x86_64 0.3.16-4.1.el6 base 83 k libraw1394-devel x86_64 2.0.4-1.el6 base 37 k librtmp-devel x86_64 2.3-1.el6.rf rpmforge 16 k libtheora-devel x86_64 1:1.1.0-2.el6 base 33 k opencore-amr-devel x86_64 0.1.2-1.el6.rf rpmforge 34 k orc-compiler x86_64 0.4.16-6.el6 epel 17 k orc-devel x86_64 0.4.16-6.el6 epel 39 k schroedinger-devel x86_64 1.0.10-1.el6.rf rpmforge 90 k x264-devel x86_64 0.0.0-0.4.20101111.el6.rf rpmforge 304 k Transaction Summary ================================================================================ Install 22 Package(s) Total download size: 5.3 M Installed size: 19 M Is this ok [y/N]: y Downloading Packages: (1/22): SDL-devel-1.2.14-3.el6.x86_64.rpm | 362 kB 00:00 (2/22): a52dec-devel-0.7.4-8.el6.rf.x86_64.rpm | 28 kB 00:00 (3/22): dirac-devel-1.0.2-4.el6.x86_64.rpm | 16 kB 00:00 (4/22): faac-devel-1.26-1.el6.rf.x86_64.rpm | 5.7 kB 00:00 (5/22): faad2-2.7-1.el6.rf.x86_64.rpm | 312 kB 00:00 (6/22): faad2-devel-2.7-1.el6.rf.x86_64.rpm | 9.4 kB 00:00 (7/22): ffmpeg-devel-0.6.5-1.el6.rf.x86_64.rpm | 2.9 MB 00:01 (8/22): gsm-devel-1.0.13-4.el6.x86_64.rpm | 14 kB 00:00 (9/22): imlib2-1.4.4-1.el6.rf.x86_64.rpm | 964 kB 00:00 (10/22): imlib2-devel-1.4.4-1.el6.rf.x86_64.rpm | 8.9 kB 00:00 (11/22): lame-devel-3.99.5-1.el6.rf.x86_64.rpm | 21 kB 00:00 (12/22): libdc1394-devel-2.1.2-3.4.el6.x86_64.rpm | 50 kB 00:00 (13/22): libogg-devel-1.1.4-2.1.el6.x86_64.rpm | 12 kB 00:00 (14/22): liboil-devel-0.3.16-4.1.el6.x86_64.rpm | 83 kB 00:00 (15/22): libraw1394-devel-2.0.4-1.el6.x86_64.rpm | 37 kB 00:00 (16/22): librtmp-devel-2.3-1.el6.rf.x86_64.rpm | 16 kB 00:00 (17/22): libtheora-devel-1.1.0-2.el6.x86_64.rpm | 33 kB 00:00 (18/22): opencore-amr-devel-0.1.2-1.el6.rf.x86_64.rpm | 34 kB 00:00 (19/22): orc-compiler-0.4.16-6.el6.x86_64.rpm | 17 kB 00:00 (20/22): orc-devel-0.4.16-6.el6.x86_64.rpm | 39 kB 00:00 (21/22): schroedinger-devel-1.0.10-1.el6.rf.x86_64.rpm | 90 kB 00:00 (22/22): x264-devel-0.0.0-0.4.20101111.el6.rf.x86_64.rpm | 304 kB 00:00 -------------------------------------------------------------------------------- Total 1.3 MB/s | 5.3 MB 00:04 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : 2:libogg-devel-1.1.4-2.1.el6.x86_64 1/22 Installing : 1:libtheora-devel-1.1.0-2.el6.x86_64 2/22 Installing : a52dec-devel-0.7.4-8.el6.rf.x86_64 3/22 Installing : gsm-devel-1.0.13-4.el6.x86_64 4/22 Installing : librtmp-devel-2.3-1.el6.rf.x86_64 5/22 Installing : faad2-2.7-1.el6.rf.x86_64 6/22 Installing : faad2-devel-2.7-1.el6.rf.x86_64 7/22 Installing : dirac-devel-1.0.2-4.el6.x86_64 8/22 Installing : SDL-devel-1.2.14-3.el6.x86_64 9/22 Installing : liboil-devel-0.3.16-4.1.el6.x86_64 10/22 Installing : imlib2-1.4.4-1.el6.rf.x86_64 11/22 Installing : imlib2-devel-1.4.4-1.el6.rf.x86_64 12/22 Installing : x264-devel-0.0.0-0.4.20101111.el6.rf.x86_64 13/22 Installing : opencore-amr-devel-0.1.2-1.el6.rf.x86_64 14/22 Installing : libraw1394-devel-2.0.4-1.el6.x86_64 15/22 Installing : libdc1394-devel-2.1.2-3.4.el6.x86_64 16/22 Installing : faac-devel-1.26-1.el6.rf.x86_64 17/22 Installing : orc-compiler-0.4.16-6.el6.x86_64 18/22 Installing : orc-devel-0.4.16-6.el6.x86_64 19/22 Installing : schroedinger-devel-1.0.10-1.el6.rf.x86_64 20/22 Installing : lame-devel-3.99.5-1.el6.rf.x86_64 21/22 Installing : ffmpeg-devel-0.6.5-1.el6.rf.x86_64 22/22 Verifying : lame-devel-3.99.5-1.el6.rf.x86_64 1/22 Verifying : orc-devel-0.4.16-6.el6.x86_64 2/22 Verifying : ffmpeg-devel-0.6.5-1.el6.rf.x86_64 3/22 Verifying : orc-compiler-0.4.16-6.el6.x86_64 4/22 Verifying : faac-devel-1.26-1.el6.rf.x86_64 5/22 Verifying : libraw1394-devel-2.0.4-1.el6.x86_64 6/22 Verifying : 2:libogg-devel-1.1.4-2.1.el6.x86_64 7/22 Verifying : opencore-amr-devel-0.1.2-1.el6.rf.x86_64 8/22 Verifying : x264-devel-0.0.0-0.4.20101111.el6.rf.x86_64 9/22 Verifying : 1:libtheora-devel-1.1.0-2.el6.x86_64 10/22 Verifying : imlib2-1.4.4-1.el6.rf.x86_64 11/22 Verifying : faad2-devel-2.7-1.el6.rf.x86_64 12/22 Verifying : liboil-devel-0.3.16-4.1.el6.x86_64 13/22 Verifying : SDL-devel-1.2.14-3.el6.x86_64 14/22 Verifying : schroedinger-devel-1.0.10-1.el6.rf.x86_64 15/22 Verifying : dirac-devel-1.0.2-4.el6.x86_64 16/22 Verifying : libdc1394-devel-2.1.2-3.4.el6.x86_64 17/22 Verifying : faad2-2.7-1.el6.rf.x86_64 18/22 Verifying : librtmp-devel-2.3-1.el6.rf.x86_64 19/22 Verifying : imlib2-devel-1.4.4-1.el6.rf.x86_64 20/22 Verifying : gsm-devel-1.0.13-4.el6.x86_64 21/22 Verifying : a52dec-devel-0.7.4-8.el6.rf.x86_64 22/22 Installed: ffmpeg-devel.x86_64 0:0.6.5-1.el6.rf Dependency Installed: SDL-devel.x86_64 0:1.2.14-3.el6 a52dec-devel.x86_64 0:0.7.4-8.el6.rf dirac-devel.x86_64 0:1.0.2-4.el6 faac-devel.x86_64 0:1.26-1.el6.rf faad2.x86_64 0:2.7-1.el6.rf faad2-devel.x86_64 0:2.7-1.el6.rf gsm-devel.x86_64 0:1.0.13-4.el6 imlib2.x86_64 0:1.4.4-1.el6.rf imlib2-devel.x86_64 0:1.4.4-1.el6.rf lame-devel.x86_64 0:3.99.5-1.el6.rf libdc1394-devel.x86_64 0:2.1.2-3.4.el6 libogg-devel.x86_64 2:1.1.4-2.1.el6 liboil-devel.x86_64 0:0.3.16-4.1.el6 libraw1394-devel.x86_64 0:2.0.4-1.el6 librtmp-devel.x86_64 0:2.3-1.el6.rf libtheora-devel.x86_64 1:1.1.0-2.el6 opencore-amr-devel.x86_64 0:0.1.2-1.el6.rf orc-compiler.x86_64 0:0.4.16-6.el6 orc-devel.x86_64 0:0.4.16-6.el6 schroedinger-devel.x86_64 0:1.0.10-1.el6.rf x264-devel.x86_64 0:0.0.0-0.4.20101111.el6.rf Complete! |
ffmpeg-php-0.6.0.tbz2をダウンロードします
1 2 3 4 5 6 7 8 9 10 11 |
[root@host1 src]# wget http://jaist.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2 --2013-04-20 17:25:34-- http://jaist.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2 jaist.dl.sourceforge.net をDNSに問いあわせています... 150.65.7.130, 2001:200:141:feed::feed jaist.dl.sourceforge.net|150.65.7.130|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 200 OK 長さ: 275557 (269K) [application/octet-stream] `ffmpeg-php-0.6.0.tbz2' に保存中 100%[======================================>] 275,557 1.11M/s 時間 0.2s 2013-04-20 17:25:34 (1.11 MB/s) - `ffmpeg-php-0.6.0.tbz2' へ保存完了 [275557/275557] |
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 |
[root@host1 src]# tar jxvf ffmpeg-php-0.6.0.tbz2 ffmpeg-php-0.6.0/ ffmpeg-php-0.6.0/tests/ ffmpeg-php-0.6.0/tests/test_media/ ffmpeg-php-0.6.0/tests/test_media/robot.avi ffmpeg-php-0.6.0/tests/test_media/16Hz-20kHz-Exp-1f-5sec.mp3 ffmpeg-php-0.6.0/tests/getFrameRate.phpt ffmpeg-php-0.6.0/tests/getPixelAspectRatio.phpt ffmpeg-php-0.6.0/tests/getFrameHeight.phpt ffmpeg-php-0.6.0/tests/getFileName.phpt ffmpeg-php-0.6.0/tests/getDuration.phpt ffmpeg-php-0.6.0/tests/getPTS.phpt ffmpeg-php-0.6.0/tests/getFramesForwardPassedEnd.phpt ffmpeg-php-0.6.0/tests/getAudioStreamId.phpt ffmpeg-php-0.6.0/tests/isKeyFrame.phpt ffmpeg-php-0.6.0/tests/getFramesBackwards.phpt ffmpeg-php-0.6.0/tests/getAudioCodec.phpt ffmpeg-php-0.6.0/tests/persistentMovie.phpt ffmpeg-php-0.6.0/tests/getFramesForward.phpt ffmpeg-php-0.6.0/tests/getFrameCount.phpt ffmpeg-php-0.6.0/tests/getVideoCodec.phpt ffmpeg-php-0.6.0/tests/getAudioChannels.phpt ffmpeg-php-0.6.0/tests/getAudioBitRate.phpt ffmpeg-php-0.6.0/tests/getFrame.phpt ffmpeg-php-0.6.0/tests/getAudioSampleRate.phpt ffmpeg-php-0.6.0/tests/getVideoBitRate.phpt ffmpeg-php-0.6.0/tests/getFrameWidth.phpt ffmpeg-php-0.6.0/tests/getBitRate.phpt ffmpeg-php-0.6.0/tests/getPixelFormat.phpt ffmpeg-php-0.6.0/tests/getID3Info.phpt ffmpeg-php-0.6.0/tests/hasAudio.phpt ffmpeg-php-0.6.0/tests/getVideoStreamId.phpt ffmpeg-php-0.6.0/tests/getNextKeyFrame.phpt ffmpeg-php-0.6.0/tests/getFrameNumber.phpt ffmpeg-php-0.6.0/tests/getFramesNoArg.phpt ffmpeg-php-0.6.0/LICENSE ffmpeg-php-0.6.0/gd.h ffmpeg-php-0.6.0/EXPERIMENTAL ffmpeg-php-0.6.0/CREDITS ffmpeg-php-0.6.0/php_ffmpeg.h ffmpeg-php-0.6.0/TODO ffmpeg-php-0.6.0/config.m4 ffmpeg-php-0.6.0/ffmpeg_movie.c ffmpeg-php-0.6.0/ChangeLog ffmpeg-php-0.6.0/test_ffmpeg.php ffmpeg-php-0.6.0/ffmpeg_movie.h ffmpeg-php-0.6.0/ffmpeg_errorhandler.c ffmpeg-php-0.6.0/INSTALL ffmpeg-php-0.6.0/ffmpeg_frame.c ffmpeg-php-0.6.0/ffmpeg_frame.h ffmpeg-php-0.6.0/ffmpeg-php.c ffmpeg-php-0.6.0/gd_io.h ffmpeg-php-0.6.0/ffmpeg_tools.c ffmpeg-php-0.6.0/ffmpeg_tools.h |
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 |
[root@host1 src]# cd ffmpeg-php-0.6.0 [root@host1 ffmpeg-php-0.6.0]# phpize Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 [root@host1 ffmpeg-php-0.6.0]# ./configure checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for a sed that does not truncate output... /bin/sed checking for cc... cc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking whether cc understands -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib checking for PHP extension directory... /usr/lib64/php/modules checking for PHP installed headers prefix... /usr/include/php checking if debug is enabled... no checking if zts is enabled... no checking for re2c... re2c checking for re2c version... 0.13.5 (ok) checking for gawk... gawk checking for ffmpeg support... yes, shared checking whether to force gd support in ffmpeg-php... no checking for ffmpeg headers... ...found in /usr/include/libavcodec checking for ffmpeg libavcodec.so... ...found in /usr/lib64 checking for ffmpeg swscale support... yes checking for a sed that does not truncate output... (cached) /bin/sed checking for fgrep... /bin/grep -F checking for ld used by cc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1966080 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for ar... ar checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from cc object... ok checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if cc supports -fno-rtti -fno-exceptions... no checking for cc option to produce PIC... -fPIC -DPIC checking if cc PIC flag -fPIC -DPIC works... yes checking if cc static flag -static works... no checking if cc supports -c -o file.o... yes checking if cc supports -c -o file.o... (cached) yes checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no configure: creating ./config.status config.status: creating config.h config.status: executing libtool commands [root@host1 ffmpeg-php-0.6.0]# make /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg-php.c -o ffmpeg-php.lo libtool: compile: cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c -o ffmpeg_movie.lo libtool: compile: cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c -fPIC -DPIC -o .libs/ffmpeg_movie.o /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘_php_read_av_frame’: /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:1215: 警告: ‘avcodec_decode_video’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3452) /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c -o ffmpeg_frame.lo libtool: compile: cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c -fPIC -DPIC -o .libs/ffmpeg_frame.o /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_toGDImage’: /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function) /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.) /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_ffmpeg_frame’: <font color=red>/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function) make: *** [ffmpeg_frame.lo] エラー 1</font> |
エラーでmakeできません。PIX_FMT_RGBA32で調べるとありました
ffmpeg-phpのコンパイル時のエラー
http://fkob.net/blog/2012/02/ffmpeg-php%E3%81%AE%E3%82%B3%E3%83%B3%E3%83%91%E3%82%A4%E3%83%AB%E6%99%82%E3%81%AE%E3%82%A8%E3%83%A9%E3%83%BC/
理由はわからないのですが^^;; 取り敢えず同じように”PIX_FMT_RGBA32″を”PIX_FMT_RGB32″に変更しました
1 2 3 4 5 6 |
[root@host1 ffmpeg-php-0.6.0]# cp ffmpeg_frame.c ffmpeg_frame.c.org [root@host1 ffmpeg-php-0.6.0]# vi ffmpeg_frame.c [root@host1 ffmpeg-php-0.6.0]# grep PIX_FMT_RGB32 ffmpeg_frame.c _php_convert_frame(ff_frame, PIX_FMT_RGB32); avpicture_alloc((AVPicture*)frame, PIX_FMT_RGB32, width, height); ff_frame->pixel_format = PIX_FMT_RGB32; |
再度make
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 |
[root@host1 ffmpeg-php-0.6.0]# make /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c -o ffmpeg_frame.lo libtool: compile: cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c -fPIC -DPIC -o .libs/ffmpeg_frame.o /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_errorhandler.c -o ffmpeg_errorhandler.lo libtool: compile: cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_errorhandler.c -fPIC -DPIC -o .libs/ffmpeg_errorhandler.o /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_tools.c -o ffmpeg_tools.lo libtool: compile: cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_tools.c -fPIC -DPIC -o .libs/ffmpeg_tools.o /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_tools.c: In function ‘ffmpeg_img_convert’: /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_tools.c:79: 警告: passing argument 2 of ‘sws_scale’ from incompatible pointer type /usr/include/libswscale/swscale.h:195: note: expected ‘const uint8_t * const*’ but argument is of type ‘uint8_t **’ /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/libavcodec/ -I/usr/include/libavformat/ -I/usr/include/libavutil/ -I/usr/include/libswscale/ -I/usr/include/libavfilter/ -I/usr/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -o ffmpeg.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/src/ffmpeg-php-0.6.0/modules ffmpeg-php.lo ffmpeg_movie.lo ffmpeg_frame.lo ffmpeg_errorhandler.lo ffmpeg_tools.lo -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lswscale -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lavformat -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lavcodec libtool: link: cc -shared .libs/ffmpeg-php.o .libs/ffmpeg_movie.o .libs/ffmpeg_frame.o .libs/ffmpeg_errorhandler.o .libs/ffmpeg_tools.o -L/usr/lib64 -lswscale -lavformat -lavcodec -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/usr/lib64 -Wl,-soname -Wl,ffmpeg.so -o .libs/ffmpeg.so libtool: link: ( cd ".libs" && rm -f "ffmpeg.la" && ln -s "../ffmpeg.la" "ffmpeg.la" ) /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=install cp ./ffmpeg.la /usr/local/src/ffmpeg-php-0.6.0/modules libtool: install: cp ./.libs/ffmpeg.so /usr/local/src/ffmpeg-php-0.6.0/modules/ffmpeg.so libtool: install: cp ./.libs/ffmpeg.lai /usr/local/src/ffmpeg-php-0.6.0/modules/ffmpeg.la libtool: finish: PATH="/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/src/ffmpeg-php-0.6.0/modules ---------------------------------------------------------------------- Libraries have been installed in: /usr/local/src/ffmpeg-php-0.6.0/modules If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- Build complete. Don't forget to run 'make test'. |
1 2 |
[root@host1 ffmpeg-php-0.6.0]# make install Installing shared extensions: /usr/lib64/php/modules/ |
phpにffmpegのモジュールを認識させます
1 2 3 4 |
[root@host1 ffmpeg-php-0.6.0]# vi /etc/php.d/ffmpeg.ini [root@host1 ffmpeg-php-0.6.0]# cat /etc/php.d/ffmpeg.ini extension=ffmpeg.so |
1 2 3 4 5 6 7 |
[root@host1 ffmpeg-php-0.6.0]# php -m [PHP Modules] (snip) ffmpeg (snip) [Zend Modules] |