Report this

What is the reason for this report?

How to install ffmpeg on App Platform

Posted on October 2, 2021

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.



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!

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.

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

Hi there,

Quick update here, the App Platform now supports this via Aptfile:

https://docs.digitalocean.com/products/app-platform/reference/buildpacks/aptfile/

App Platform looks for a file named Aptfile (no file extension) to detect an application requiring system packages. If this file is detected, the heroku-buildpack-apt buildpack is used to install any packages listed in the Aptfile during the build process.

The following example Aptfile declares three system packages to install:

libpq-dev
imagemagick
curl

This example installs:

  • libpq-dev: A library for PostgreSQL applications.
  • imagemagick: A command-line tool for image processing.
  • curl: A command line tool for making HTTP requests.

Another option here remains the usage of a Dockerfile which gives you more flexibility:

https://docs.digitalocean.com/products/app-platform/reference/dockerfile/

Hope that this helps!

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.