Hi,
On 28.04.2014 23:37, Mikael Nordfeldth wrote:
Hello, I would like to present a patch which will help build
'php5-ffmpeg' against libav-0.9, after passing a hurdle which is not
handled by the patch.
thanks for the patch, it works. ;)
The hurdle is that 'libavutil-dev' has the header file 'time.h':
$ apt-file search libavutil/time.h
libavutil-dev: /usr/include/libavutil/time.h
[...]
The include path /usr/include/libavutil is added when the build scripts
configure ffmpeg-php, so the "<time.h>" references in various system
libraries get pointed to the _wrong_ time.h. The workaround I came up
with (because I did not come up with a proper solution) was to add:
#include "/usr/include/time.h"
into /usr/include/libavutil/time.h
If the wrong time.h is read, as is the case for the first issue of this
FTBFS, several declarations of structs such as 'time_t' are missing.
There is a patch for this in the upstream bug tracker [1], but most of
this patch is irrelevant for the version in Debian (which probably
should be updated), as it seems not to include headers from libavutil.
Attached is a stripped down version, that allows (together with
building ffmpeg-php with libav9.
The attached patch fixes the problems which occur _after_ the time.h
issue is fixed. The patch is designed to be put into the
'debian/patches' directory and added last in the 'debian/patches/series'
file. I don't currently know much more on how to package patches for
Debian projects :)
This package could use an update to source format 3.0 (quilt) [2].
While this makes it build alright, there is some kind of problem
remaining. I get bad frame counts on the getFrameCount() call (45888
frames instead of something like 190), while referencing frames with
getFrame(n) still fetches properly, in my test case the last fetchable
frame being 188.
So if someone else could please have a look at how to make it build with
the colliding libavutil/time.h we're soon able to have this package back
in the repositories :)
I'm wondering if this package should be back in jessie, because upstream
seems to be dead since 2009 and even with these patches it fails to
build with FFmpeg2.2/libav10, that are coming to Debian now [3][4]:
/tmp/buildd/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function
'_php_get_codec_name':
/tmp/buildd/ffmpeg-php-0.6.0/ffmpeg_movie.c:955:28: error:
'AVCodecContext' has no member named 'sub_id'
if (decoder_ctx->sub_id == 2)
^
/tmp/buildd/ffmpeg-php-0.6.0/ffmpeg_movie.c:957:33: error:
'AVCodecContext' has no member named 'sub_id'
else if (decoder_ctx->sub_id == 1)
^
sub_id got deprecated and subsequently removed, because "this field is
unused" [5].
I think, what this package needs is a new upstream.
Best regards,
Andreas
1: http://sourceforge.net/p/ffmpeg-php/bugs/59/
2: https://wiki.debian.org/Projects/DebSrc3.0
3: https://bugs.debian.org/729203
4: https://bugs.debian.org/739079
5:
http://sources.debian.net/src/libav/6:9.11-3/libavcodec/avcodec.h?hl=1377#L1377
diff --git a/config.m4 b/config.m4
index 778007c..0a20095 100644
--- a/config.m4
+++ b/config.m4
@@ -35,7 +35,6 @@ if test "$PHP_FFMPEG" != "no"; then
dnl so we have to include them all.
PHP_ADD_INCLUDE($i/include/libavcodec/)
PHP_ADD_INCLUDE($i/include/libavformat/)
- PHP_ADD_INCLUDE($i/include/libavutil/)
PHP_ADD_INCLUDE($i/include/libswscale/)
PHP_ADD_INCLUDE($i/include/libavfilter/)
PHP_ADD_INCLUDE($i/include/libavdevice/)