Laravel 无法加载 FFProbe?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29916963/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 11:27:45  来源:igfitidea点击:

Laravel unable to load FFProbe?

phplaravelffmpeg

提问by ReactingToAngularVues

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 FFMpeginstance:

我正在使用 PHP-FFMpeg 存储库在我的 Laravel 应用程序中执行一些视频工作,但是我在设置它时遇到了一些问题。安装 PHP-FFMpeg 存储库后,我尝试创建一个FFMpeg实例:

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

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

但是,这不起作用。作为回应,我收到一个 ErrorException ,它只是说明:

Unable to load FFProbe

This does not make sense to me, as when I run ffmpegand ffprobefrom 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?

这是没有意义的给我,我跑的时候ffmpeg,并ffprobe从我的Mac的终端,我可以看到他们正在安装。这显然是一个路径/解决问题,但我不确定如何解决它。有任何想法吗?

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

这一切都托管在一个 MAMP 项目下,在本地主机上运行。

回答by Limon Monte

Specifying paths to binaries should help:

指定二进制文件的路径应该会有所帮助:

$ffmpeg = \FFMpeg\FFMpeg::create([
    'ffmpeg.binaries'  => exec('which ffmpeg'),
    'ffprobe.binaries' => exec('which ffprobe')
]);

回答by Entrust

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

your ffmpeg installation path.

你的ffmpeg安装路径。

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

这就是@limonte 的意思,它对我有用。

回答by Rashid Akram

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

我花了很多时间来研究这个,我将这个答案发布给在 Windows 上遇到类似问题的任何人。图书馆删除了反斜杠

(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

这将适用于寡妇。希望这可以帮助

回答by Saurabh Mistry

For Mac OS :

对于 Mac 操作系统:

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

For Windows :

对于 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'