使用 ebextensions 配置在弹性 beantalk 上安装 ffmpeg [英] Install ffmpeg on elastic beanstalk using ebextensions config

查看:19
本文介绍了使用 ebextensions 配置在弹性 beantalk 上安装 ffmpeg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 amazon 服务器上的弹性 beanstalk 实例上安装最新版本的 ffmpeg.我已经创建了我的配置文件并添加了这些 container_commands:

I'm attempting to install an up to date version of ffmpeg on an elastic beanstalk instance on amazon servers. I've created my config file and added these container_commands:

    container_commands:
        01-ffmpeg:
            command: wget -O/usr/local/bin/ffmpeg http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.2014-03-05.tar.gz
            leader_only: false
        02-ffmpeg:
            command: tar -xzf /usr/local/bin/ffmpeg
            leader_only: false
        03-ffmpeg:
            command: ln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg
            leader_only: false

命令 01 和 03 似乎运行良好,但 02 似乎不起作用,因此 ffmpeg 无法解压缩.任何想法可能是什么问题?

Command 01 and 03 seems to work perfectly but 02 doesn't seem to work so ffmpeg doesn't unzip. Any ideas what the issue might be?

谢谢,海伦

推荐答案

亚马逊的一个好心人帮了我一把,并把这个有效的配置文件发给了我,希望其他人会觉得这很有用:

A kind person at Amazon helped me out and sent me this config file that works, hopefully some other people will find this useful:

# .ebextensions/packages.config
packages:
  yum:
    ImageMagick: []
    ImageMagick-devel: []
commands:
  01-wget:
    command: "wget -O /tmp/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz"
  02-mkdir:
    command: "if [ ! -d /opt/ffmpeg ] ; then mkdir -p /opt/ffmpeg; fi"
  03-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-4.2.2-amd64-static/ffmpeg /usr/bin/ffmpeg; fi"
  05-ln:
    command: "if [[ ! -f /usr/bin/ffprobe ]] ; then ln -sf /opt/ffmpeg/ffmpeg-4.2.2-amd64-static/ffprobe /usr/bin/ffprobe; fi"
  06-pecl:
    command: "if [ `pecl list | grep imagick` ] ; then pecl install -f imagick; fi"

编辑:
以上代码适用于我今天 2020-01-03,在 Elastic Beanstalk 环境中Python 3.6 running on 64bit Amazon Linux/2.9.17.
https://johnvansickle.com/ffmpeg/ 链接自官方 ffmpeg 站点.
(以前来自 Gusari 的静态构建似乎不再可用.)

Edit:
The above code works for me today 2020-01-03, in Elastic Beanstalk environment Python 3.6 running on 64bit Amazon Linux/2.9.17.
https://johnvansickle.com/ffmpeg/ is linked from the official ffmpeg site.
(The former static build from Gusari does not seem available anymore.)

警告:
部署时,上述内容将始终下载最新版本.您还依赖于 johnvansickle 的站点在线(进行部署),并且他的 URL 不会改变.两种替代方法是:

Warning:
The above will always download the latest release when you deploy. You're also depending on johnvansickle's site being online (to deploy), and his URL not changing. Two alternative approaches would be:

  • 将 .tar.xz 文件下载到您自己的 CDN,然后让您的部署从您自己的站点下载.(这样,如果 John 的站点在您部署时出现停机时间,您不会受到影响.而且您不会对 ffmpeg 版本的更改感到惊讶,而您却没有意识到.)
  • 指定版本号,例如 https://johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.2.2-amd64-static.tar.xz.

这篇关于使用 ebextensions 配置在弹性 beantalk 上安装 ffmpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆