tony2001 / ffmpeg-php

PHP extension for video editing, wrapping ffmpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failed make test

gillecaluim opened this issue · comments

built ffmpeg from git:
ffmpeg version N-54015-gfa125c5 Copyright (c) 2000-2013 the FFmpeg developers
built on Jun 13 2013 09:04:16 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-3)
configuration: --enable-avfilter --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfdk_aac --enable-libvpx --enable-libvorbis --enable-libtheora --enable-pthreads --enable-shared --enable-nonfree --enable-gpl --enable-postproc
libavutil 52. 35.101 / 52. 35.101
libavcodec 55. 16.100 / 55. 16.100
libavformat 55. 8.102 / 55. 8.102
libavdevice 55. 2.100 / 55. 2.100
libavfilter 3. 76.101 / 3. 76.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100

running make test lists several errors:
issue 1:
SKIP ffmpeg get key frames test [tests/getNextKeyFrame.phpt] reason: gd extension not avaliable. Even though gd gd-devel php-gd installed

issue 2:
FAIL ffmpeg getID3Info() test [tests/getID3Info.phpt]
Even though libmp3lame installed
issue 3:
FAIL ffmpeg persistent movie test [tests/persistentMovie.phpt]

I see the same problems, plus some additional test failures when built against recent ffmpeg. I do have a fix for the getID3Info() test though!

The gd extension is not being found because the Makefile is calling php with -d extension_dir=$(top_builddir)/modules/ so modules from the standard extension directory are not found (statically built modules are, of course). Not sure how to fix this (since the Makefile is generated by phpize/configure and I don't see any applicable setting in config.m4), but because of this, all 8 tests using gd are skipped .

The getID3Info test is failing on getYear():

/usr/src/packages/BUILD/ffmpeg-php/tests/getID3Info.phpt
================================================================================
ffmpeg getTitle(): Test mp3
ffmpeg getArtist(): Alexander Thomas
ffmpeg getAlbum(): MP3 test files (http://www.dr-lex.be/software/testsounds.html#Tones)
ffmpeg getGenre(): Sound Clip
ffmpeg getTrackNumber(): 3
ffmpeg getYear():
================================================================================
006+ ffmpeg getYear():
006- ffmpeg getYear(): 2008
================================================================================

This is because the ffmpeg metadata key for this is date, not year, as verified by running avio_reading on the test file. (I don't know if this was a change in ffmpeg, or has always been broken here.) The following one-liner fixes this:

diff --git a/ffmpeg_movie.c b/ffmpeg_movie.c
index ec165f7..62a684b 100644
--- a/ffmpeg_movie.c
+++ b/ffmpeg_movie.c
@@ -591,7 +591,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getTrackNumber)
  */
 FFMPEG_PHP_METHOD(ffmpeg_movie, getYear)
 {
-       php_get_dict_value(INTERNAL_FUNCTION_PARAM_PASSTHRU, "year");
+       php_get_dict_value(INTERNAL_FUNCTION_PARAM_PASSTHRU, "date");
 }
 /* }}} */

Additionally I get failures for getBiteRate, getDuration, and getFrameCount:

ffmpeg getBitRate(): 183185
================================================================================
001+ ffmpeg getBitRate(): 183185^M
001- ffmpeg getBitRate(): 183948
================================================================================

ffmpeg getDuration(): 9.64
================================================================================
001+ ffmpeg getDuration(): 9.64^M
001- ffmpeg getDuration(): 9.60
================================================================================

ffmpeg getFrameCount(): 241
================================================================================
001+ ffmpeg getFrameCount(): 241^M
001- ffmpeg getFrameCount(): 240
================================================================================

Build environment is SLES 11, php53-5.3.17-0.35.2, libffmpeg-devel-2.6.1-2.1 with libavcodec56, libavformat56, libavutil54 (ffmpeg stuff installed from packman repo).

If I instead build against libffmpeg_oldabi-devel-0.7.16-3.6 (libavcodec52, libavformat52, libavutil50), and s/avformat_close_input/av_close_input_file/to match the old API (undoing 3 lines of f29e69d), these three tests pass.