0

I want to get the duration of a movie, using ffprobe (part of ffmpeg). The command line I'm using is this:

ffprobe -v error -show_entries format=duration -of
default=noprint_wrappers=1:nokey=1
path/to/video.mov

It works perfectly in the shell, gives me a result of 4.5554 (seconds).

However, if I call this command via exec on my local machine, I get an empty result.

var_dump( exec("ffprobe -v .......") );
returns string(0) ""

Now comes the burner: It works perfectly on the production machine, though!!

These are my configurations:

Local machine:        Mac OS 10.9.5,      PHP 5.6.11   ffmpeg 2.7.1
Production machine:   Mac OS Server 10.6  PHP 5.3.1    ffmpeg 2.7.2

Is this kind of a bug in PHP 5.6 or something??? Thanks, Matt

Kinesias
  • 354
  • 1
  • 5
  • 18
  • so capture the return value and examine that. `exec($cmd, $output, $return_val); var_dump($return_val)` – Marc B Jul 27 '15 at 18:29
  • `var_dump($return_val)` returns `int(5)` which is wrong, the movie is 4 seconds – Kinesias Jul 27 '15 at 18:36
  • `var_dump($output)` returns `array(0) { }` – Kinesias Jul 27 '15 at 18:36
  • the return value has NOTHING to do with your movie length. it's how ffmpeg signals problems. – Marc B Jul 27 '15 at 18:39
  • where can I look up what "problem code 5" will mean? – Kinesias Jul 27 '15 at 18:45
  • if I add 2>&1 et the end, if gives me: `string(67) " in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO" array(4) { [0]=> string(51) "dyld: Symbol not found: __cg_jpeg_resync_to_restart" [1]=> string(82) " Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO" [2]=> string(63) " Expected in: /Applications/XAMPP/xamppfiles/lib/libJPEG.dylib" [3]=> string(67) " in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO" } int(133)` – Kinesias Jul 27 '15 at 19:00

1 Answers1

0

I've found the solution.

I had a 5 corrupt libraries in Applications/XAMPP/xamppfiles/lib. I had to copy and paste them from /System/Library/Frameworksto the XAMPP library folder and replace the old, corrupt ones by the fresh ones.

Now, all works fine, locally and on the production machine.

Thanks!!!

Kinesias
  • 354
  • 1
  • 5
  • 18