Latest blog entry

error: PIX_FMT_RGBA32 undeclared

September 30, 2009    |   Posted by admin   |    Category: Linux Administration

The error message “Unable to load dynamic library ‘/usr/lib64/php/modules/ffmpeg.so” is received when you add the ffmpeg.so extension to the PHP configuration file i.e. php.ini file and tries to run PHP. You can easily reproduce the error message by executing “php -v”:

PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/ffmpeg.so’ – /usr/lib64/php/modules/ffmpeg.so: undefined symbol: _php_create_ffmpeg_frame in Unknown on line 0

You may also notice the “PIX_FMT_RGBA32” error message while compiling ffmpeg-php

ffmpeg-php-0.5.0/ffmpeg_frame.c:495: error: ‘PIX_FMT_RGBA32′ undeclared (first use in this function)

The above error messages is the result of incorrect function declared in the ffmpeg_frame.c file under the ffmpeg-php-0.x.0 directory.

Solution:

Goto the the ffmpeg-php-0.x.0 directory and edit the ffmpeg_frame.c file

vi ffmpeg-php-0.x.0/ffmpeg_frame.c

Now replace every instance of ‘PIX_FMT_RGBA32’ with ‘PIX_FMT_RGB32’ in the file by executing

:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

OR

replace “PIX_FMT_RGBA32” “PIX_FMT_RGB32” — ffmpeg_frame.c

Save the file and compile ‘ffmpeg-php’ again using the following steps

cd ffmpeg-php-0.x.0
make clean
./configure
make
make install

Once done, ffmpeg should work along with PHP now.