Paul Ledger
Paul Ledger

Reputation: 1135

How to install ffmpeg using xampp

I am trying to install ffmpeg onto my localhost server. I have followed countless blogs and tutorials online form other people who are stuck with this same problem. I follow everything to the letter.

  1. Unzip the file
  2. Copy php_ffmpeg.exe to ext folder in php
  3. copy the rest to system 32

As it says however when I do this I get this error when I start apache.

error message

Fair play but it is in the folder

Here is my file

I also get this error as well:

Second error

And Again, here it is: second file placement

I have added the extention to my php.ini file

extension=php_ffmpeg.dll

The first time I go this to work I placed the ffmpeg.exe file onto my local host server and ran commands like this:

$cmd = "$ffmpegpath -i $input -an -ss $sec -s $size $output";
shell_exec($cmd);

This works fine on my computer but not on an actual server. Could somebody offer some advice or guidene on where I have one wrong installing the extension or why running the .exe file on a lunix server with shell_exec doesn't work

Upvotes: 0

Views: 3414

Answers (1)

Lawrence Cherone
Lawrence Cherone

Reputation: 46602

Yeah ive had problems with the extension version, with windows. I found it is much easier to not use the PHP extension and just call the standard FFMPEG for windows binary with exec() within a simple class, ive added an example script. It will be trivial for you to add a ffmpeg_convert() method to the class.

VideoThumbNailer.example.zip

Edit

Just noticed this statement,

Could somebody offer some advice or guidene on where I have one wrong installing the extension or why running the .exe file on a lunix server with shell_exec doesn't work

Linux has its own versions of FFMPEG, you cant mix the two. Your need to install FFMPEG on linux with something like:

sudo apt-get -qqy php5-ffmpeg

And change the path to FFMPEG in your cmd to, leaving out the .exe part:

ffmpeg -i $input -an -ss $sec -s $size $output

Hope it helps

Upvotes: 1

Related Questions