amazon-web-services - FFMPEG 在 AWS Lambda 中失败

标签 amazon-web-services ffmpeg aws-lambda h.264 aac

我正在尝试为短视频创建转码功能。该函数托管在 AWS Lambda 上。问题是 AWS lambda 似乎缺少 FFMPEG 需要的东西,至少根据亚马逊的说法。

我之前联系了亚马逊,这是他们对这个问题的回应:

We found that the FFMPEG operations require at least libx264 and an acc library, both of which will have dependencies of their own. To troubleshoot the issue it will involve diving deeper into the full dependency chain. We can see that it works in the Amazon Linux environment however, the environment is similar but not identical to the lambda environment. There can be some dependencies that exist in Amazon Linux but not in lambda environment as Lambda runs on the container. Here, as FFmpeg is a third party software, diving deeper into the dependency chain and verifying the version compatibilities is very hard to do. Unfortunately going further, this is bound to go into architecture and code support which is out of AWS Support scope 1. I hope you understand our limitations. However should FFmpeg support have any questions specific to the Lambda platform, please do let us know and we will be happy to assist. We will be in better position to investigate further once you receive an update from the FFmpeg support suggesting an issue from Lambda end.



根据 AWS 的建议,我联系了开发人员邮件列表上的 FFMPEG,我的邮件被拒绝了,原因是它比开发人员更适合 ffmpeg 用户邮件列表。一周前我向“ffmpeg-user@ffmpeg.org”发送了一封电子邮件,但尚未收到任何回复。

然后,我构建了一个动态链接的 ffmpeg 版本,确保打包所有库,检查每个库的 ddl,然后制作一个小的 lambda 函数,循环所有二进制文件并对它们中的每一个进行 ddled,与我从亚马逊获得的输出相比Linux 和相同的依赖项/版本在 lambda 和 AWS Linux 实例上都存在,但 ffmpeg 在 lambda 上仍然失败。

您可以在此处找到详细的日志文件:https://www.datafilehost.com/d/6e5e21bb

这是我得到的错误示例,在整个日志文件中重复:

2018-08-14T12:27:10.874Z [h264 @ 0x65c2fc0] concealing 2628 DC, 2628 AC, 2628 MV errors in P frame

2018-08-14T12:27:10.874Z [aac @ 0x65d2f00] channel element 2.11 is not allocated

2018-08-14T12:27:10.874Z Error while decoding stream #0:1: Invalid data found when processing input

2018-08-14T12:27:10.874Z [h264 @ 0x67e86c0] Invalid NAL unit size (108085662 > 1649).

2018-08-14T12:27:10.874Z [h264 @ 0x67e86c0] Error splitting the input into NAL units.

2018-08-14T12:27:10.874Z [aac @ 0x65d2f00] channel element 2.0 is not allocated

2018-08-14T12:27:10.874Z Error while decoding stream #0:1: Invalid data found when processing input

2018-08-14T12:27:10.874Z [h264 @ 0x68189c0] Invalid NAL unit size (71106974 > 1085).

2018-08-14T12:27:10.874Z [h264 @ 0x68189c0] Error splitting the input into NAL units.

2018-08-14T12:27:10.874Z [aac @ 0x65d2f00] Pulse tool not allowed in eight short sequence.



尝试对此文件执行 HLS 转码时会生成此日志:https://www.datafilehost.com/d/999a4492

请注意,该问题与该文件无关,也与 HLS 无关,它一般发生在所有视频和任何试图寻找流的 ffmpeg 命令上,甚至尝试使用最简单的形式从视频中提取单个帧例如:ffmpeg -ss 00:00:02 -I file.mp4 -vframes 1 -y output.jpg也会失败,日志文件中出现相同的错误。

不知道如何进一步调试。尝试使用“-loglevel debug”启用调试日志,但没有给我任何额外信息。任何帮助或建议

最佳答案

我今天遇到了完全相同的问题并花了几个小时。但最后我遇到了这个SO answer并找到了解决方案。

基本上你需要确保你没有将 STDIN 传递给 FFmpeg 进程。 re:Invent 演讲中提到了 on this slide .

关于amazon-web-services - FFMPEG 在 AWS Lambda 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52251752/

相关文章:

打印警告 : EOF timestamp not reliable 后 FFmpeg 卡住

php - 在网站 : Red5 stream or posting the audio data? 上录制音频

Bash 脚本在 while 循环中停止执行 ffmpeg - 为什么?

amazon-web-services - 基于位置的AWS AppSync事件订阅

java - AWS DynamoDbMapper 错误...由 : javax.net.ssl.SSLProtocolException 引起:

amazon-web-services - 如何与组织中的其他用户共享 lambda 函数

amazon-web-services - 向 Slack 发送 SNS 通知

node.js - 使用适用于 Java 的 AWS 开发工具包调用 AWS Lambda 函数时如何检索 context.done() 消息?

amazon-web-services - EMR 命令运行程序如何提交作业

node.js - DynamoDB BatchGet 总是给出 "The provided key element does not match the schema"