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.
- Download ffmpeg from here: https://ffmpeg.org/download.html
- Copy php_ffmpeg.dll from the php5 folder to the C:\wamp\bin\php\php5.2.9-2\ext
- Copy files from common to the windows/system32 folder
- Add extension=php_ffmpeg.dll to php.ini file ( \apache...php.ini )
- 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,
- From command line
composer require php-ffmpeg/php-ffmpeg
- 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
Easiest Form Validation Library For PHP
Error: "Input Is Not Proper Utf-8, Indicate Encoding !" Using PHP'S Simplexml_Load_String
Do I Have to Guard Against SQL Injection If I Used a Dropdown
PHP: Writing a Simple Removeemoji Function
Best Way to Check If MySQL_Query Returned Any Results
Composer Warning: Openssl Extension Is Missing. How to Enable in Wamp
How to Detect Strings Like Putjbtghguhjjjanika
Persistent/Keepalive Http With the PHP Curl Library
Upload Video Files Via PHP and Save Them in Appropriate Folder and Have a Database Entry
In PHP With Pdo, How to Check the Final SQL Parametrized Query
Best Practice Multi Language Website
How to Write to the Console in PHP
How to Add Exif Data to an Image
Eloquent Orm Code Hinting in PHPstorm
Multiple MySQL Insert Statements in One Query PHP
Insert Query on Page Load, Inserts Twice