FFMpeg with lavfi on AWS lambda fails

0

I'm having an issue using lavfi in FFMpeg running on a lambda function. I've followed the directions here to install the John Van Sickle ffmpeg layer. I am able to do a simple convert command from python 3.9 via subprocess. So something like ffmpeg -i /tmp/in.mov /tmp/out.mp4 works fine.

Whenever I run a lavfi command via python3 subprocess

/opt/bin/ffmpeg -f lavfi -i movie=/tmp/test.ts[out0+subcc] -map 0:1 -f webvtt /tmp/test.vtt

The Lambda does not timeout but it does not create the /tmp/test.vtt file. If I list the tmp directory after the ffmpeg command but before the lambda finishes, I see that it creates an ffmpeg.core.## file where ## is a random number. I did a cat of that file and got a bunch of garbage. Is this a core dump because of a segmentation fault?

I can run the lavfi command above on an Amazon Linux ec2 with the same build of ffmpeg. Any thoughts on why this might be? Does lavfi require permissions to write a temp file to a directory other than tmp and that causes a write error? Trying to figure if there is any way I can get lavfi to work on lambda.

질문됨 일 년 전284회 조회
1개 답변
0

Hello,

Are you using the defaults for the lambda that you are creating? By default a lambda only allows 512 MB of space in the /tmp directory. https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html And only allocates 128MB of ram for your lambda function. https://docs.aws.amazon.com/lambda/latest/operatorguide/computing-power.html I could easily see you over running those limits and causing ffmpeg to core dump.

Hope this helps! Craig

profile pictureAWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠