error: PIX_FMT_RGBA32 undeclared

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.

This entry was posted on Wednesday, September 30th, 2009 and is filed under Linux Administration. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

7 Responses to “error: PIX_FMT_RGBA32 undeclared”

  1. vks

    Thank you So much……My ffmpeg-php works nowwwww

  2. Spechal

    Thanks! Replacing the lines in ffmpeg_frame.c and redoing configure, make and make install got my php-ffmepg running!

  3. Jase Clamp

    You are wonderful. Thank you for writing up this help!

  4. Joe Ebel

    Thank you!! Saved my day!

  5. Dave

    Thanks. Works.

  6. Prabhakar

    thanks it helped me …

    Wounder why this article has not been pickedup by search engine while searching ..

  7. admin

    It’s right there at the top for common words/tags of this post but yes, it might not be there for the keywords you used. What were the keywords you used while searching for this solution?