PDA

Bekijk Volledige Versie : Debian Etch en php5-ffmpeg



johan.smits
15/08/09, 14:23
Met mijn applicatie wil ik gebruik maken van de php lib ffmpeg.
Nu zit deze standaard in lenny maar onze productie servers draaien nog op etch.

Nu ben ik al de hele ochtend aan het compilen maar echter zonder succes.

iemand een tutorial hoe php5-ffmpeg te gebruiken in debian etch??

Of zijn er mensen die een deb hebben gemaakt?

BuGoff
16/08/09, 03:44
In /etc/apt/sources.list

deb http://www.debian-multimedia.org etch main

apt-get update

apt-get install debian-keyring

apt-get install ffmpeg bzip2 php5-dev

cd /usr/src/

wget http://kent.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2

cd ffmpeg-php-0.6.0/

phpize

./configure && make

make install

vi /etc/php5/php.ini

extension=ffmpeg.so


dit zou het ongeveer wel moeten doen.

johan.smits
16/08/09, 08:54
Hoi BuGoff,

ik was ook zover, alleen als ik na phpize ./configure draai krijg ik deze foutmelding:
configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option

Zie hier de volledige output:

web02:/usr/src/ffmpeg-php-0.6.0# phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
web02:/usr/src/ffmpeg-php-0.6.0# ./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/20060613+lfs
checking for PHP installed headers prefix... /usr/include/php5
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for ffmpeg support... yes, shared
checking whether to force gd support in ffmpeg-php... no
checking for ffmpeg headers...
configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option
Mis ik een pakket?

Elke suggestie is welkom.

Johan

Curryworst
16/08/09, 09:44
je moet de ./configure draaien met de --enable-shared optie zoals je in de error log ziet.

Herbert
16/08/09, 09:51
Johan je moet ./configure --enable-shared gebruiken voor ffmpeg
/path naar ffmpeg/make clean
/path naar ffmpeg/configure --enable-shared

johan.smits
17/08/09, 21:11
heb ik ook geprobeerd maar zie output:

web02:/usr/src/ffmpeg-php-0.6.0# ./configure --enable-shared
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/20060613+lfs
checking for PHP installed headers prefix... /usr/include/php5
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for ffmpeg support... yes, shared
checking whether to force gd support in ffmpeg-php... no
checking for ffmpeg headers...
configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option

Of zie ik nu toch nog iets over het hoofd?
De ffmpeg versie is:

web02:/usr/src/ffmpeg-php-0.6.0# ffmpeg -v
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --prefix=/usr --libdir=${prefix}/lib --shlibdir=${prefix}/lib --incdir=${prefix}/include/ffmpeg --enable-shared --enable-libmp3lame --enable-gpl --enable-libfaad --mandir=${prefix}/share/man --enable-libvorbis --enable-pthreads --enable-libfaac --enable-xvid --enable-libdts --enable-amr_nb --enable-amr_wb --enable-pp --enable-libogg --enable-libgsm --enable-x264 --enable-liba52 --enable-libtheora --extra-cflags=-Wall -g -fPIC -DPIC --cc=ccache cc --enable-swscaler
libavutil version: 49.4.0
libavcodec version: 51.40.2
libavformat version: 51.11.0
built on Feb 4 2008 14:45:57, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

Graag een idee wat te doen.

Herbert
18/08/09, 00:23
Probeer eens:


./configuration --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include/ffmpeg --enable-libmp3lame --enable-libogg --enable-libvorbis --enable-libogg --enable-libtheora --enable-libfaad --enable-libfaac --enable-libgsm --enable-xvid --enable-x264 --enable-liba52 --enable-liba52bin --enable-pp --enable-shared --enable-pthreads --enable-gpl --disable-strip

De bovenstaande configure komt van mijn ffmpeg op CentOS
Mocht het niet lukken dan de laatste svn versie gebruiken!

johan.smits
18/08/09, 21:19
Ben een stap verder, moest deze nog toevoegen:

apt-get install libavcodec-dev

Krijg nu alleen deze fout:

/usr/src/ffmpeg-php-0.6.0# make
/bin/sh /usr/src/ffmpeg-php-0.6.0/libtool --mode=compile gcc -I. -I/usr/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/src/ffmpeg-php-0.6.0/include -I/usr/src/ffmpeg-php-0.6.0/main -I/usr/src/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wno-deprecated-declarations -Wall -fno-strict-aliasing -c /usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c -o ffmpeg_frame.lo
gcc -I. -I/usr/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/src/ffmpeg-php-0.6.0/include -I/usr/src/ffmpeg-php-0.6.0/main -I/usr/src/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wno-deprecated-declarations -Wall -fno-strict-aliasing -c /usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c -fPIC -DPIC -o .libs/ffmpeg_frame.o
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'zim_ffmpeg_frame_toGDImage':
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: 'PIX_FMT_RGBA32' undeclared (first use in this function)
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.)
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'zim_ffmpeg_frame_ffmpeg_frame':
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: 'PIX_FMT_RGBA32' undeclared (first use in this function)
make: *** [ffmpeg_frame.lo] Error 1

Moet nog uitzoeken waarom.
Iemand een idee?
heb ./configure --enable-shared gedraaid voordat make uitvoer

Herbert
18/08/09, 21:25
Probeer eens:


./configuration --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include/ffmpeg --enable-libmp3lame --enable-libogg --enable-libvorbis --enable-libogg --enable-libtheora --enable-libfaad --enable-libfaac --enable-libgsm --enable-xvid --enable-x264 --enable-liba52 --enable-liba52bin --enable-pp --enable-shared --enable-pthreads --enable-gpl --disable-strip

De bovenstaande configure komt van mijn ffmpeg op CentOS
Mocht het niet lukken dan de laatste svn versie gebruiken!
Edit:
Ik zie het nu pas, ./configuration moet zijn ./configure

johan.smits
18/08/09, 21:28
Edit:
Ik zie het nu pas, ./configuration moet zijn ./configure

Maar dan nog klopt het niet helemaal:
--incdir moet zijn: --includedir

Maar zit nog met make error zoals in 2 post hierboven.

Jammer dat er geen deb van is voor etch :(

Herbert
18/08/09, 21:57
Sorry voor de andere fout Johan.
Ik kan mij herinneren dat in de 0.6.0 een bug zat, ik had toen de laatste svn versie genomen die deed het wel.
Het is al een tijdje geleden dat ik ffmpeg erop heb gezet, en dit was eenmalig voor mij.
Hij draait nog wel op een server van mij, voor de rest weet ik ook niet?
Heb je GD wel geinstalleerd?
Ik zie ook bij jou:
checking whether to force gd support in ffmpeg-php... no

johan.smits
18/08/09, 22:22
probleem is verholpen.
Miste nog deze pakketten: apt-get install libavformat-dev libavformat0d libavformatcvs51 libavformatcvs51-dev

En er zit inderdaad een bug in de 0.6.0 je moet met vi: %s/PIX_FMT_RGBA32/PIX_FMT_RGB32 doen op de ffmpeg_frame.c file.
Anders krijg je de bovenstaande fout.

Dus problem SOLVED

Thnx voor de response

johan.smits
19/08/09, 20:58
Problem unsolved,

Compilen werkt, en php ziet hem ook als plugin.
Zie phpinfo:

ffmpeg-php version 0.6.0-svn
ffmpeg-php built on Aug 18 2009 21:11:57
ffmpeg-php gd support enabled
ffmpeg libavcodec version Lavc52.32.0
ffmpeg libavformat version Lavf52.37.0
ffmpeg swscaler disabled


Maar als ik mijn script run met php ffmpeg.php krijg ik een Segmentation fault
in apache log kom ik dit tegen:

[Wed Aug 19 20:02:58 2009] [error] [client xx.xx.xx.xx] PHP Notice: ffmpeg_movie::__construct() [<a href=''></a>]: Header: 4BF10A01\n in /data/sites/_default/http/temp/ffmpeg.php on line 7
[Wed Aug 19 20:02:58 2009] [error] [client xx.xx.xx.xx] PHP Notice: ffmpeg_movie::__construct() [<a href=''></a>]: Profile 1:\nfrmrtq_postproc=5, bitrtq_postproc=31\nLoopFilter=0, MultiRes=0, FastUVMC=0, Extended MV=0\nRangered=0, VSTransform=1, Overlap=1, SyncMarker=0\nDQuant=0, Quantizer mode=0, Max B frames=0\n in /data/sites/_default/http/temp/ffmpeg.php on line 7
[Wed Aug 19 20:02:59 2009] [notice] child pid 15560 exit signal Segmentation fault (11)
Hoe kan ik dit debuggen om te kijken waar het fout gaat?
Script klopt want op lenny met php-ffmpeg werkt het goed.

Elk idee is welkom

johan.smits
20/08/09, 21:23
niemand???