0
votes

I'm trying to convert a jpg image to mp4 and transcode a mp4 file with ffmpeg on AWS lambda.

For the first task I issue the following:

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

and for the second:

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

The funny thing is that the aforementioned tasks (jpg conversion and video transcoding) complete successfully, both locally and on AWS lambda, but I'm getting the below error messages:

Locally: "err: ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers"

AWS LAMBDA: "err: ffmpeg version N-89977-gddd851f7cb-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers"

Additionally, on AWS Lambda, the function exits with error, which results in re-execution of the function.

I searched for solutions to no avail. Any suggestions?

1
Change t 2 to -t 2. Remove -strict -2 because the FFmpeg AAC encoder has not been experimental for a few years now. - llogan

1 Answers

0
votes

Remove or update the -v 9 on the command line. According to the Generic Option Docs, the verbosity levels are:

-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’

If I run ffmpeg -v 9 the program exits with a value of 1, indicating a failure.