2

This is not a duplicate, I have found one thread, and it is outdated and does not work: Install ffmpeg on elastic beanstalk using ebextensions config.

I have been trying to install this for some time, nothing seems to work. Please share the config.yml that will make this work.

I am using 64bit Amazon Linux 2016.03 v2.1.6 running PHP 7.0 on Elastic Beanstalk


My current file is

branch-defaults: 
  default: 
    environment: Default-Environment
  master: 
    environment: Default-Environment
global: 
  application_name: "My First Elastic Beanstalk Application"
  default_ec2_keyname: ~
  default_platform: "64bit Amazon Linux 2016.03 v2.1.6 running PHP 7.0"
  default_region: us-east-1
  profile: eb-cli
  sc: git
packages: ~
yum: 
  ImageMagick: []
  ImageMagick-devel: []
  commands: 
    01-wget: 
      command: "wget -O /tmp/ffmpeg.tar.gz http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.2014-03-05.tar.gz"
    02-mkdir: 
      command: "if [ ! -d /opt/ffmpeg ] ; then mkdir -p /opt/ffmpeg; fi"
    03-tar: 
      command: "tar -xzf ffmpeg.tar.gz -C /opt/ffmpeg"
      cwd: /tmp
    04-ln: 
      command: "if [[ ! -f /usr/bin/ffmpeg ]] ; then ln -s /opt/ffmpeg/ffmpeg /usr/bin/ffmpeg; fi"
    05-ln: 
      command: "if [[ ! -f /usr/bin/ffprobe ]] ; then ln -s /opt/ffmpeg/ffprobe /usr/bin/ffprobe; fi"
    06-pecl: 
      command: "if [ `pecl list | grep imagick` ] ; then pecl install -f imagick; fi"
Community
  • 1
  • 1
Nick Lynch
  • 59
  • 7

3 Answers3

4

Following configuration worked for me. Try using specific version and make sure folder name is correct based on the version of ffmpeg.

File .ebextensions/03_ffmpeg_package.config

packages:
  yum:
    ImageMagick: []
    ImageMagick-devel: []
commands:
  01-wget:
    command: "wget -O /tmp/ffmpeg.tar.xz https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-3.4.2-64bit-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-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"
  06-pecl:
    command: "if [ `pecl list | grep imagick` ] ; then pecl install -f imagick; fi"

I am using the static build from this link John Van Sickle - FFmpeg Static Builds

Khadija
  • 63
  • 5
0

Try the following .ebextensions/00-install-ffmpeg.config file:

commands:
  01-install:
    command: "wget http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.latest.tar.gz -O - | tar zxf - -C /usr/bin"
Francis Eytan Dortort
  • 1,407
  • 14
  • 20
0

Another way is as simple as download a static build of ffmpeg, zip it and upload it to a S3 bucket or anywhere online and add this to an ebextension

sources:    
  /etc/ffmpeg: https://url-to/ffmpeg-static-file.zip
xploshioOn
  • 4,035
  • 2
  • 28
  • 37