0

Using elasticbeanstalk with Node.js 10 running on 64bit Amazon Linux 2/5.2.3. I have a packages.config file under .ebextensions folder.

   packages:
  yum:
    ImageMagick: []
    ImageMagick-devel: []
commands:
  01-wget:
    command: "wget -O /tmp/ffmpeg.tar.xz http://ffmpeg.org/releases/ffmpeg-4.1.tar.gz"
  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.1/ffmpeg /usr/bin/ffmpeg; fi"
  05-ln:
    command: "if [[ ! -f /usr/bin/ffprobe ]] ; then ln -sf /opt/ffmpeg/ffmpeg-4.1/ffprobe /usr/bin/ffprobe; fi"
  06-pecl:
    command: "if [ `pecl list | grep imagick` ] ; then pecl install -f imagick; fi"

I am using fluent-ffmpeg@2.1.2 module for saving screenshot.

Marcin
  • 215,873
  • 14
  • 235
  • 294
Ali Ahmed
  • 1
  • 2
  • Did you inspect EB log files for more detailed error messages? – Marcin Dec 31 '20 at 11:46
  • yes @Marcin `Dec 31 11:41:54 ip-172-31-46-171 web: Cannot process video: Error: Cannot find ffprobe Dec 31 11:41:54 ip-172-31-46-171 web: (node:10094) UnhandledPromiseRejectionWarning: Cannot find ffprobe Dec 31 11:41:54 ip-172-31-46-171 web: (node:10094) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)` – Ali Ahmed Dec 31 '20 at 11:50

1 Answers1

0

You are just downloading and unpacking the source code of ffmpeg. Before you can use ffmpeg and ffprobe you have to compile the code. Without this, your scripts will not work.

To compile, you can try run the following commands in /opt/ffmpeg/ffmpeg-4.1 folder:

./configure  --disable-x86asm
make

However, compilation will be time consuming. This it would be better probably to compile everything, store the binaries in S3 for example, or bundle with your application zip, to save a lot of time.

Marcin
  • 215,873
  • 14
  • 235
  • 294