Question

How to install ffmpeg on App Platform

Posted October 2, 2021 141 views
Node.jsDigitalOcean App Platform

Hi folks, how can I install the FFmpeg on the App Platform? I notice the console does not allow access to the apt command. Is there a way to make this work using the build command? I think this can be possible using Docker as well, but I really don’t know how to set an image for NodeJS apps like the NodeJS buildpack is doing for me right now.

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.

×
Submit an Answer
2 answers

đź‘‹ @brunononatoquaresma

Commands like apt are not currently supported. Like you mentioned, the workaround is to deploy from a Dockerfile or build your own container image.

To run a NodeJS app without Buildpacks, one option is to use node as the base image in your Dockerfile (DockerHub link):

FROM node:16

RUN apt update && \
    apt install -y ffmpeg

EXPOSE 8080
ADD server.js .
ENTRYPOINT ["node", "server.js"]

I wrote server.js to verify I can run ffmpeg commands in my NodeJS app. I can share the source code if that’s helpful.

Hope this helps!

Not a fix for your problem, but an alternative option you might be interested in.

You can use FFMPEG WASM for many basic to medium FFMPEG use cases right in the browser.

That’s what I use.

Caveat: Works on Chrome latest (92+) best. And you gotta have some headers present for SharedArrayBuffer to work well. Just a heads up.