0

While installing FFmpeg-PHP, I got this interesting error:

/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:
In function
'zim_ffmpeg_movie_getAudioStreamId':
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1051:
error: 'CODEC_TYPE_AUDIO' undeclared
(first use in this function)
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:
In function
'zim_ffmpeg_movie_getAudioChannels':
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1089:
error: 'CODEC_TYPE_AUDIO' undeclared
(first use in this function)
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:
In function
'zim_ffmpeg_movie_getAudioSampleRate':
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1125:
error: 'CODEC_TYPE_AUDIO' undeclared
(first use in this function)
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:
In function
'zim_ffmpeg_movie_getAudioBitRate':
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1161:
error: 'CODEC_TYPE_AUDIO' undeclared
(first use in this function)
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:
In function
'zim_ffmpeg_movie_getVideoBitRate':
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1181:
error: 'CODEC_TYPE_VIDEO' undeclared
(first use in this function)
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:
In function '_php_read_av_frame':
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1204:
error: 'CODEC_TYPE_VIDEO' undeclared
(first use in this function)
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1215:
warning: implicit declaration of
function 'avcodec_decode_video'
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1219:
error: 'PKT_FLAG_KEY' undeclared
(first use in this function)
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:
In function '_php_get_av_frame':
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1246:
error: 'CODEC_TYPE_VIDEO' undeclared
(first use in this function)
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1282:
error: 'AVCodecContext' has no member
named 'hurry_up'
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1284:
error: 'AVCodecContext' has no member
named 'hurry_up'
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:
In function
'_php_get_sample_aspect_ratio':
/usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1443:
error: 'CODEC_TYPE_VIDEO' undeclared
(first use in this function) make: ***
[ffmpeg_movie.lo] Error 1

When I ran php -r 'phpinfo();' | grep ffmpeg, I got this:

PHP Warning:  PHP Startup: Unable to
load dynamic library
'/usr/lib/php/modules/ffmpeg.so' -
libavformat.so.52: cannot open shared
object file: No such file or directory
in Unknown on line 0

Any idea how I can fix this? I am running on Centos.

Thanks in advance :)

1
  • Have you tried using YUM? Also, ServerFault.com might be a better place to ask this, voting to close.
    – Alix Axel
    Apr 24, 2011 at 0:03

3 Answers 3

1

for this:

PHP Warning:  PHP Startup: Unable to
load dynamic library
'/usr/lib/php/modules/ffmpeg.so' -
libavformat.so.52: cannot open shared
object file: No such file or directory
in Unknown on line 0

With your ffmpeg configure options you will need

--enable-shared

If you are still having issues check the paths:

 export LD_LIBRARY_PATH=/usr/local/lib/
 echo /usr/local/lib > /etc/ld.so.conf.d/custom-libs.conf
 ldconfig

Run:

ldconfig

After

make && make install
1
  • What type of OS/Distro are you using?
    – ALex_hha
    Jul 24, 2013 at 9:45
0

It looks like you're missing the libavformat library. You should be able to install this via the yum package manager.

yum install ffmpeg

If it still doesn't work, try installing the development library

yum install ffmpeg-devel
10
  • @sreimer I already have ffmpeg installed. When I ran ffmpeg I got this information (I didn't post it all): "FFmpeg version git-N-29309-gc225615" // "libavcodec 53. 1. 0 / 53. 1. 0" I also tried installing the development library but that didn't work either. The same error appears each time I try to install FFmpeg-php
    – tundoopani
    Apr 27, 2011 at 5:28
  • According to this not having libavcodec-dev libavformat-dev and libswscale-dev installed will produce a similar error.
    – sreimer
    Apr 27, 2011 at 13:50
  • @sreimer All of those are installed. Could it possibly be the version of ffmpeg?
    – tundoopani
    Apr 28, 2011 at 6:55
  • are you compiling from source?
    – sreimer
    Apr 28, 2011 at 14:11
  • @sreimer I used git clone git://git.videolan.org/ffmpeg.git. Is there a better way?
    – tundoopani
    Apr 28, 2011 at 15:54
0

Check your system for libavcodec/libavformat, it may just be missing from your library path, or you may have a different version than expected installed.

find / -name 'libavformat*.so*' -print

and see what it comes back with, if you have libavformat.so.53 when your installed ffmpeg is expected .so.52, there is your problem.

3
  • If so, just create a symlink, for e.g: ln -s /usr/lib/libavformat.so.53 /usr/lib/libavformat.so.52.
    – quanta
    Oct 27, 2011 at 3:43
  • That is not a great idea, it would be better to recompile ffmpeg to link to the proper libraries, although as long as you are going backwards, not forwards, it might work.
    – Allan Jude
    Oct 28, 2011 at 14:09
  • warning: implicit declaration of function ‘avcodec_init’
    – tundoopani
    Jan 28, 2013 at 21:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .