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?

2 Answers 2

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);
Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.