How to Install Ffmpeg For PHP

How to install ffmpeg for PHP

The easiest solution is to download an already compiled ffmpeg binary/executable and point your script to it. On the FFmpeg Download page refer to the Get the packages section for links to recent static builds for Linux, Windows, and macOS.

You can use shell_exec() as shown in FFmpeg Wiki: PHP and provide the full path to the downloaded binary.

Install FFMPEG on XAMPP

You can follow steps from here or do the following steps.

  1. Download ffmpeg from here: https://ffmpeg.org/download.html
  2. Copy php_ffmpeg.dll from the php5 folder to the C:\wamp\bin\php\php5.2.9-2\ext
  3. Copy files from common to the windows/system32 folder
  4. Add extension=php_ffmpeg.dll to php.ini file ( \apache...php.ini )
  5. Restarted all services (Apache, PHP...)

And enable "extension=php_ffmpeg.dll" directive in your php.ini.

Install FFMPEG on WAMP

Yes, having a 64-bit computer may make a difference. Try putting the "common" files in C:\Windows\SysWow64 instead of system32.

If that doesn't work, try using DependencyWalker to check the missing DLLs (open php_ffmpeg.dll with it)

i have installed composer and now need to install php_ffmpeg

There are two ways to do that,

  1. From command line
composer require php-ffmpeg/php-ffmpeg

  1. Add to "require" section into your composer.json

"require": {
"php-ffmpeg/php-ffmpeg": "dev-master"
}

and execute

composer install

php-ffmpeg installation on apache2

Issue was the paths

'ffmpeg.binaries' => 'usr/bin/ffmpeg',
'ffprobe.binaries' => 'usr/bin/ffprobe'

Whereas:

'ffmpeg.binaries' => '/usr/bin/ffmpeg',
'ffprobe.binaries' => '/usr/bin/ffprobe'

Is working.



Related Topics



Leave a reply



Submit