【问题标题】:AWS elastic beanstalk UnhandledPromiseRejectionWarning: Cannot find ffprobeAWS弹性beantalk UnhandledPromiseRejectionWarning:找不到ffprobe
【发布时间】:2021-04-07 17:48:44
【问题描述】:

将 elasticbeanstalk 与在 64 位 Amazon Linux 2/5.2.3 上运行的 Node.js 10 结合使用。我在 .ebextensions 文件夹下有一个 packages.config 文件。

   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"

我正在使用 fluent-ffmpeg@2.1.2 模块来保存屏幕截图。

【问题讨论】:

  • 您是否检查了 EB 日志文件以获取更详细的错误消息?
  • 是的@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)

标签: node.js amazon-web-services ffmpeg amazon-elastic-beanstalk ffprobe


【解决方案1】:

你只是在下载和解压ffmpeg的源代码。在您可以使用ffmpegffprobe 之前,您必须编译 代码。没有这个,您的脚本将无法运行。

要编译,您可以尝试在/opt/ffmpeg/ffmpeg-4.1 文件夹中运行以下命令:

./configure  --disable-x86asm
make

但是,编译会耗时。最好编译所有内容,例如将二进制文件存储在 S3 中,或者与您的应用程序 zip 捆绑在一起,以节省大量时间。

【讨论】:

    猜你喜欢
    • 2016-11-29
    • 2020-11-15
    • 1970-01-01
    • 2018-08-27
    • 2020-12-16
    • 2015-05-22
    • 2017-11-25
    • 2014-01-26
    • 2014-10-21
    相关资源
    最近更新 更多