Question

How can I make sure that FFmpeg is on system path?

I have been trying to deploy my app through Github with automatic update. I’ve run into a problem where if I try to use my app it will error out with FFmpegNotFound (One of the packages I’m using requires it). I have tried to add it to the environment variables as well as manually adding it both with ‘export’ on Bash and in ‘~/.bashrc’ but neither seem to work. Also anything I do is reset every time the system rebuilds so I’m wondering if there’s anything I can do that will fix this issue and be permanent.


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.

KFSys
Site Moderator
Site Moderator badge
March 27, 2023

Hello,

If you are talking about a Droplet rather than App platform, you can use the full system path. Once you are inside your Droplet type in :

  1. which ffmpeg

As for an App platform, this might not be the prettiest solution but I managed to do this with a run_command and downloading ffmpeg manually and adding it to the path in line.

You can probably do this in a script setup.sh or similar but for simplicties sake I did it with the sample-php app and inline with the command that starts it.

Here was my run_command:

run_command: cd && mkdir -p bin/ffmpeg-build && pushd bin/ffmpeg-build && wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz
    && tar xf ffmpeg-git-amd64-static.tar.xz && cd ffmpeg-git-20220910-amd64-static
    && mv * ../../ && popd && rm -rf ./bin/ffmpeg-build && export PATH=$PATH:/workspace/bin
    && heroku-php-apache2

The instructions on how to install I found here: https://gist.github.com/jmsaavedra/62bbcd20d40bcddf27ac

and I had to modify them because the link presented in the gist 404’ed. I found the links to download ffmpeg from: https://ffmpeg.org/download.html

Which when you click the static binaries it redirects you to https://johnvansickle.com/ffmpeg/.

Try DigitalOcean for free

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

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

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

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
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