Deploy a function for file processing with FFMPEG


currently I’m working on the processing of files with ffmpeg. My first attempt was to deploy the ffmpeg stuff within an existing node.js docker container on the digitialocean app platform. The file processing uses much memory and cpu, what causes a crash and forces a restart of the app.

First of all, I don’t understand, why this should happen on app platform, because a docker container should only be allowed to use the designated memory and not just crash, if it uses 100% for more than 5 seconds. We can’t upgrade the plan from Basic 5$ dollars to 300$/month just because of that one feature.

Second, now I try to outsource this functionality inside of a function with ffmpeg-static + fluent-ffmpeg. But ‘doctl serverless deploy’ throws 413 payload too large. On my disk the zip file has 43 MB. I thought the limit is 48 MB? Can you assist me with that problem?

Thanks in advance.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
August 23, 2023

Hi there,

It would be expected for a service to crash if there isn’t enough memory. This is not an App Platform-specific thing but would occur on a standard Linux server as well.

The $5 container on the App Platform comes with only 512MB of RAM, and as far as I am aware FFMPEG requires around 2GB of RAM. What you could do is to upgrade your container with 2GB of RAM which will be around $20 per month rather than upgrading to a $300 per month instance straight away.

As the zip file is 43MB while zipped, it is likely to exceed the 48MB limit after unzipped, which makes it a not very suitable use-case for serverless functions. An alternative approach will be to spin up a Droplet and run your app on there, that way you will have full control over the server:

Hope that this helps.



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel