Home > Blockchain >  How to permanently make ffmpeg recognizable from bin/bash in macOS
How to permanently make ffmpeg recognizable from bin/bash in macOS

Time:04-11

I downloaded a zip for ffmpeg, because brew installation was not compatible with macOS High Sierra 10.13.6. After unzipping, the only file contained was ffmpeg, its icon is similar to the icon of the terminal. I want to get the terminal(which runs bin/bash $SHELL) to permanently recognise ffmpeg command.

If I type:

  1. echo export PATH="/Users/imac/Documents/ffmpeg:$PATH" > ~/.bashrc
  2. source ~/.bashrc
  3. ffmpeg then the command ffmpeg is recognized, so everything is ok.

However if I exit the terminal and re-open it, or just restart the computer ffmpeg gives as output -bash: ffmpeg: command not found. So I have to do every time steps 1 and 2 that were describe above.

  1. Output of cat .bashrc : export PATH=/Users/imac/Documents/ffmpeg:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin

  2. Output of echo $PATH : /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin

Note that in step 4 ffmpeg appears(in the location I have it stored) whereas in step 5 ffmpeg is absent. Also I have little knowledge of bash and terminal, so if you can, please be explanatory in answers and/or comments. Thank you very much!

CodePudding user response:

Follow these steps:

  1. cd ~; nano .bash_profile
  2. Copy and Paste -in the bottom- the path you want to add, as follows
    export PATH="<Replace with the path>:$PATH"
  3. Save settings

Note: <...> are meant to be replaced

E.g. for me it was:
export PATH="/Users/imac/Documents/ffmpeg:$PATH"

  • Related