1

i've installed the php_ffmpeg extension on my xampp under c:/xampp/php/ext/php_ffmpeg.dll - according to phpinfo() it seems to be properly installed. however - when trying to create a thumbnail from a video it is executing without errors, but i'm not getting any image .. the apache error log is showing: command "ffmpeg" is either mis-spelled or couldn't be found. my code is:

$cmd = "ffmpeg  -i myvideo.flv -f mjpeg -vframes 1 -s 150x150 -an thumbnail.jpg";
exec($cmd);

any ideas what's wrong?

Fuxi
  • 7,611
  • 25
  • 93
  • 139

2 Answers2

1

You don't have ffmpeg installed or it's not in your path. What you're doing here has nothing to do with the php_ffmpeg extension. You're attempting to execute the ffmpeg binary.

See the API documentation for php_ffmpeg if you wish to try using it.

Michael Mior
  • 28,107
  • 9
  • 89
  • 113
1

You're executing a shell command (ffmpeg -i ...) outside PHP, without using the PHP extension ffmpeg-php. That extension provides some functions to PHP, see ffmpeg-php API documentation.

If you insist on using the ffmpeg command-line program, take a look at the ffmpeg project. Windows binaries can be downloaded here. The documentation for the commandline application ffmpeg can be reached from here. If necessary, use the full path to the ffmpeg binary:

$ffmpeg = "C:\\Program Files\ffmpeg\ffmpeg.exe";
$cmd = "$ffmpeg  -i myvideo.flv -f mjpeg -vframes 1 -s 150x150 -an thumbnail.jpg";
exec($cmd);
Lekensteyn
  • 64,486
  • 22
  • 159
  • 192