Question

Node-ffmpeg app crashes in a Droplet

Hello!

I’m trying to run a node-ffmpeg app in a ubuntu droplet, but it keeps crashing without giving me any reason.

ffmpeg-api@1.0.0 start
NODE_ENV=production node index.mjs

[info] use ffmpeg.wasm v0.11.6
[info] load ffmpeg-core
[info] loading ffmpeg-core
[info] ffmpeg-api listening at port 3000
[info] ffmpeg-core loaded
Killed

The app is somewhat a modified version of the following tutorial (https://www.digitalocean.com/community/tutorials/how-to-build-a-media-processing-api-in-node-js-with-express-and-ffmpeg-wasm). The only difference is that it also uses some mongodb and filestack node packages. It runs perfectly well locally and in the app-platform, however it just keeps crushing in a droplet. Older commits of the app, which follow the tutorial almost exactly, are no good either.

I can confirm node.js and npm are installed and running, and my droplet is able to run a node server. Also while trying to troubleshot it I installed ffmpeg package using sudo apt-get install -y ffmpeg libgdiplus. I don’t have rich experience in droplets, so it’s probably something small I’m missing. However at this point I don’t have any ideas what is it exactly.

Do you have any advise? Thank you!


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,

The Killed message that you are getting at the end of the output, indicates that your Droplet is running out of memory.

As far as I know, FFMPEG requires around 2GB of RAM, so if your Droplet has less than that it would explain why the process is crashing.

I could suggest a couple of things:

  • Upgrade to a larger Droplet that has at least 2GB of RAM
  • Add a SWAP file so that you could have some extra memory buffer:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04

Hope that this helps!

Best,

Bobby

Try DigitalOcean for free

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

Sign up

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