如何在Mac上同时安装ffmpeg和一个应用程序?

12

我已经建立了一个Electron应用程序, 并在.app文件中打包为macOS。该应用需要用户电脑上安装FFmpeg才能使用。

目前,我必须手动在每台用户电脑上安装FFmpeg才能运行应用程序。

我希望在线发布该应用程序,并提供一个简单的安装程序来同时安装FFmpeg和应用程序。我看到过.dmg文件,可以让您轻松地将.app拖入应用程序文件夹,但是安装过程中仍然缺少FFmpeg依赖项。

如何在Mac上一次性安装FFmpeg和应用程序?

或许将FFmpeg构建包含在.app内容中也是一个解决方案。不过这可能不太可能,因为相关问题中提到只有FFmpeg CLI的抽象而没有直接使用FFmpeg的东西。


你计划只在MacOS上部署还是多平台? - Thomas Ayoub
跨平台。@ThomasAyoub - Patrick
那么你要在Windows上部署一个.dmg文件? - Thomas Ayoub
不,我特别想知道如何在macOS上完成这个过程。我会把Windows的安装过程留到另一个时间。 - Patrick
尝试使用这个。它可能会有所帮助。 - Mtoklitz113
5个回答

1
这个问题还涉及到对ffmpeg许可证的理解。总之,由于许可问题,请不要将ffmpeg与您的应用程序捆绑在一起,而是允许用户自行下载和安装ffmpeg。
您的应用程序是否作为
a. GPL - 开放源代码,并公开所有源代码
b. 非商业闭源应用程序
c. 商业应用程序
请参阅ffmpeg许可证 - https://www.ffmpeg.org/legal.html
FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later. However, FFmpeg incorporates several optional parts and optimizations that are covered by the GNU General Public License (GPL) version 2 or later. If those parts get used the GPL applies to all of FFmpeg.

Read the license texts to learn how this affects programs built on top of FFmpeg or reusing FFmpeg. You may also wish to have a look at the GPL FAQ.

Note that FFmpeg is not available under any other licensing terms, especially not proprietary/commercial ones, not even in exchange for payment.

即使使用开源应用程序,也要谨慎行事。例如,Audacity是一款流行的开源应用程序,它使用ffmpeg。请参见此处 - https://manual.audacityteam.org/man/installing_ffmpeg_for_windows.html

Because of software patents, Audacity cannot include the FFmpeg software or distribute it from its own websites. Instead, use the following instructions to download and install the free and recommended FFmpeg third-party library.

0

你应该在 .app 中包含 ffmpeg。这样,你就可以:

  • 无需管理员权限安装或更新你的应用程序。
  • 不会冲突于用户计算机上的其他 ffmpeg 副本。

请参考此答案以获取 Electron 特定的说明:如何将预编译二进制文件与 electron 打包


从应用架构的角度来看,这是最简单的解决方案,但请记住@moi所说的。ffmpeg使用LGPL许可证,这意味着在法律上你不能分发静态构建的ffmpeg。 - soundflix

0

你可以尝试这个方法在Mac上安装ffmpeg,对我来说很有效:

brew install --build-from-source ffmpeg


0
抱歉回复晚了,但如果对某人仍然有意义的话:我专门为这个目的创建了ffbinaries模块。
您可以在应用启动期间或在CI/预打包场景中下载用户平台的二进制文件(如果您不指定平台,系统将自动检测)。

0

你可以在Mac上创建一个PKG文件,安装你的应用以及任何其他第三方应用程序。你可以尝试从这里使用Seema的答案。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接