2

With the help of this guide, I am trying to install ffmpeg using these commands:

 # cd ffmpeg-php/branches/ffmpeg-php/ffmpeg-php-0.6.1/
 # replace 'PIX_FMT_RGBA32' 'PIX_FMT_RGB32' -- *
 # phpize 
 # ./configure --with-ffmpeg=/usr/local/cpffmpeg
 # make 
 # make install

But when I run this replace 'PIX_FMT_RGBA32' 'PIX_FMT_RGB32' -- * I get this error:

replace: Error reading file 'autom4te.cache' (Errcode: 21) replace: Error reading file 'build' (Errcode: 21) ffmpeg_frame.c converted replace: Error reading file 'include' (Errcode: 21) replace: Error reading file 'modules' (Errcode: 21) replace: Error reading file 'tests' (Errcode: 21)

And when I run make and skip that line I get:

/root/ffmpeg-php/branches/ffmpeg-php/ffmpeg-php-0.6.1/ffmpeg-php.c:171: error: expected '{' at end of input
make: *** [ffmpeg-php.lo] Error 1

Any ideas?

tshepang
  • 65,642

3 Answers3

1

Probably, you would need to edit the only one file i.e. ffmpeg_frame.c

replace 'PIX_FMT_RGBA32' 'PIX_FMT_RGB32' -- ffmpeg_frame.c
./configure
make
make install

This should install ffmpeg-php on the server - you will need to add the ffmpeg.so file to your php.ini file like:

extension=ffmpeg.so

Restart Apache on the server once the extension is added.

Gareth
  • 103
1

The errors from replace are harmless, it's just telling you (cryptically) that these files are directories and it can't act on them.

But you do need to run phpize and ./configure … before you can run make.

0

Can't you use yum?

On Ubuntu doing aptitude install php5-ffmpeg seems to automatically install ffmpeg and all it's dependencies. Perhaps the same package is available for CentOS?

Alix Axel
  • 2,929