AWS lambda上的ffmpeg错误

时间:2018-03-13 14:47:58

标签: amazon-web-services ffmpeg aws-lambda

我试图将jpg图像转换为mp4并使用ffmpeg在AWS lambda上转码mp4文件。

对于第一项任务,我发出以下内容:

ffmpeg -y -f lavfi -i anullsrc -loop 1 -framerate 30 -i test.jpg -t 2 -pix_fmt yuv420p -vf scale=640:480 -c:v libx264 -profile:v baseline -level 3.0 -c:a aac -map 0:a -map 1:v -strict -2 -preset ultrafast /tmp/jpg_output.mp4

和第二个:

ffmpeg -i /var/task/test.mp4 -c:v libx264 -c:a copy -strict -2 -v 9 -preset ultrafast -y /tmp/output.mp4

有趣的是,上述任务(jpg转换和视频转码)在本地和AWS lambda上都已成功完成,但我收到以下错误消息:

本地:" 错误:ffmpeg版本3.4.2版权所有(c)2000-2018 FFmpeg开发人员"

AWS LAMBDA :" 错误:ffmpeg版本N-89977-gddd851f7cb-static https://johnvansickle.com/ffmpeg/版权所有(c)2000-2018 FFmpeg开发人员 "

此外,在AWS Lambda上,函数退出时出错,导致重新执行该函数。

我搜索的解决方案无济于事。有什么建议吗?

1 个答案:

答案 0 :(得分:0)

删除或更新命令行上的-v 9。根据{{​​3}},详细程度如下:

-loglevel [repeat+]loglevel | -v [repeat+]loglevel

    Set the logging level used by the library. Adding "repeat+" indicates that repeated log output should not be compressed to the first line and the "Last message repeated n times" line will be omitted. "repeat" can also be used alone. If "repeat" is used alone, and with no prior loglevel set, the default loglevel will be used. If multiple loglevel parameters are given, using ’repeat’ will not change the loglevel. loglevel is a string or a number containing one of the following values:

    ‘quiet, -8’

        Show nothing at all; be silent. 
    ‘panic, 0’

        Only show fatal errors which could lead the process to crash, such as an assertion failure. This is not currently used for anything. 
    ‘fatal, 8’

        Only show fatal errors. These are errors after which the process absolutely cannot continue. 
    ‘error, 16’

        Show all errors, including ones which can be recovered from. 
    ‘warning, 24’

        Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown. 
    ‘info, 32’

        Show informative messages during processing. This is in addition to warnings and errors. This is the default value. 
    ‘verbose, 40’

        Same as info, except more verbose. 
    ‘debug, 48’

        Show everything, including debugging information. 
    ‘trace, 56’

如果我运行ffmpeg -v 9,程序将以值1退出,表示失败。