FFMpeg-PHP Installation Error
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 :)
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