简体   繁体   English

在弹性 beantalk 上安装 ffmpeg

[英]Installing ffmpeg on elastic beanstalk

I am trying to install ffmpeg to elastic beanstalk, I have created config file with below commands-我正在尝试将 ffmpeg 安装到弹性 beanstalk,我已经使用以下命令创建了配置文件-

packages:
  yum:
    ImageMagick: []
    ImageMagick-devel: []
commands:
  01-wget:
    command: "wget -O /tmp/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz"
  02-mkdir:
    command: "if [ ! -d /opt/ffmpeg ] ; then mkdir -p /opt/ffmpeg; fi"
  02-tar:
    command: "tar xvf /tmp/ffmpeg.tar.xz -C /opt/ffmpeg"
  04-ln:
    command: "if [[ ! -f /usr/bin/ffmpeg ]] ; then ln -sf /opt/ffmpeg/ffmpeg-3.4-64bit-static/ffmpeg /usr/bin/ffmpeg; fi"
  05-ln:
    command: "if [[ ! -f /usr/bin/ffprobe ]] ; then ln -sf /opt/ffmpeg/ffmpeg-3.4-64bit-static/ffprobe /usr/bin/ffprobe; fi"
  06-pecl:
    command: "if [ `pecl list | grep imagick` ] ; then pecl install -f imagick; fi"

Till 05-ln everything seems to be fine, but on 06-pecl I am getting below error-直到 05-ln 一切似乎都很好,但在 06-pecl 上我遇到了以下错误-

[2018-03-08T08:06:29.390Z] INFO  [32014] - [Application update app-f8f2d-180308_133451@78/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_1_FranchiseSoft/Command 06-pecl] : Completed activity. Result:
  PHP Warning:  Module 'imap' already loaded in Unknown on line 0
  /bin/sh: line 0: [: 3.1.2: binary operator expected

Nevermind, 04-ln and 05-ln were actually wrong, fixed it by- 没关系,04-ln和05-ln实际上是错误的,请通过以下方式修复它:

  04-ln:
    command: "if [[ ! -f /usr/bin/ffmpeg ]] ; then ln -sf /opt/ffmpeg/ffmpeg-3.4.2-64bit-static/ffmpeg /usr/bin/ffmpeg; fi"
  05-ln:
    command: "if [[ ! -f /usr/bin/ffprobe ]] ; then ln -sf /opt/ffmpeg/ffmpeg-3.4.2-64bit-static/ffprobe /usr/bin/ffprobe; fi"

The accepted answer does not provide enough context about the solution.接受的答案没有提供足够的解决方案上下文。

So, here's a better explanation:所以,这里有一个更好的解释:

The URL used to download the.tar file - https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz - packages the latest version of ffmpeg. It is evident by the change in the directory name when the contents are extracted.用于下载.tar文件的URL - https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz - 打包了最新版本的ffmpeg。目录的变化很明显提取内容时的名称。

As of 9th December, 2022, the name of the folder has version 5.1.1.截至 2022 年 12 月 9 日,文件夹名称的版本为 5.1.1。 Hence, the 04-ln and 05-ln need to have 5.1.1.因此,04-ln 和 05-ln 需要有 5.1.1。 to create correct symbolic links.创建正确的符号链接。

In future, if a newer version is released, the symbolic links will be not created properly and the application will fail.将来,如果发布了更新的版本,将无法正确创建符号链接并导致应用程序失败。

As one solution, you can use the following URL where you know the release version is fixed and so is the name of the folder in the tar.作为一种解决方案,您可以使用以下 URL,您知道发行版本是固定的,tar 中文件夹的名称也是固定的。 Eg: https://johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.4.1-amd64-static.tar.xz例如: https://johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.4.1-amd64-static.tar.xz

Or, you can simply host the file in your CDN which is more reliable as your deployment does not depend on an external website.或者,您可以简单地将文件托管在您的 CDN 中,这样更可靠,因为您的部署不依赖于外部网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM