How to install ffmpeg on 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.

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.

👋 @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

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!