Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel unable to load FFProbe?

I'm using the PHP-FFMpeg repository to do some video work inside my Laravel application, but I'm encountering some issues setting it up. Once I've installed the PHP-FFMpeg repo, I try and create an FFMpeg instance:

$ffmpeg = \FFMpeg\FFMpeg::create();

However, this does not work. In response, I get an ErrorException that simply states:

Unable to load FFProbe

This does not make sense to me, as when I run ffmpeg and ffprobe from my Mac's terminal, I can see they are installed. This is clearly a path/resolving issue, but I'm unsure how to fix it. Any ideas?

This is all hosted under a MAMP project, running on localhost.

like image 225
marked-down Avatar asked Apr 28 '15 10:04

marked-down


4 Answers

$ffmpeg = \FFMpeg\FFMpeg::create([
    'ffmpeg.binaries'  => '/usr/local/bin/ffmpeg',
    'ffprobe.binaries' => '/usr/local/bin/ffprobe' 
]);

your ffmpeg installation path.

that is what @limonte means, and it is working to me.

like image 81
Entrust Avatar answered Nov 07 '22 07:11

Entrust


For Mac OS :

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

For Windows :

'ffmpeg.binaries'  => 'C:/FFmpeg/bin/ffmpeg.exe',
'ffprobe.binaries' => 'C:/FFmpeg/bin/ffprobe.exe'

For Ubantu :

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

sudo apt install ffmpeg
like image 29
Saurabh Mistry Avatar answered Nov 07 '22 07:11

Saurabh Mistry


Specifying paths to binaries should help:

$ffmpeg = \FFMpeg\FFMpeg::create([
    'ffmpeg.binaries'  => exec('which ffmpeg'),
    'ffprobe.binaries' => exec('which ffprobe')
]);
like image 39
Limon Monte Avatar answered Nov 07 '22 05:11

Limon Monte


I spent a lot of time in researching this and I am posting this answer for anyone experiencing similar issue on windows. The library removes the backslashes

(D:\binaries\ffmpeg\ffmpeg.exe) 

so you should use forward slashes instead

(D:/binaries/ffmpeg/ffmpeg.exe) 

this will work on widows. Hope this helps

like image 5
Rashid Akram Avatar answered Nov 07 '22 05:11

Rashid Akram