0

Kind of a weird situation here. I use a software package called OpenCV which installs a dependency called FFMpeg located at the following path.

/root/miniconda3/bin/ffmpeg

So, whenever I run the command ffmpeg, it runs the program located at that address.

However, I don't want to use this build of ffmpeg, but rather another build located at the following path.

/usr/local/bin/ffmpeg

Not only do I want ffmpeg to point to the right one, I also want Python subprocess calls to point to the right ffmpeg, so just using bash aliases won't work. I know there's ways around Python's subprocess function that make it respect aliases, but the problem is that I'm using a 3rd party module that makes the subprocess call to FFMpeg, hence I need the ffmpeg command to refer to /usr/local/bin/ffmpeg for all intents and purposes.

I tried using a symlink but that didn't do anything.

Thanks for any assistance!

  • I tried using a symlink – How exactly? – Kamil Maciorowski Jul 5 at 10:35
  • The point of anaconda/miniconda is really to make sure to always have a particular version of a dependency in some environment. If you want your local ffmpeg instead of that particular version, I'd install OpenCV not via anaconda/miniconda, but directly. – dirkt Jul 5 at 10:35
  • @KamilMaciorowski ln -s /usr/local/bin/ffmpeg ffmpeg – Carpetfizz Jul 5 at 10:38
  • @dirkt understood but I actually need ffmpeg for another thing unrelated to OpenCV. It just so happens both programs require a different build of ffmpeg. Although /usr/local/bin/ffmpeg contains a superset of features in the one that shipped with OpenCV so I don’t suspect swapping them out will cause a problem. – Carpetfizz Jul 5 at 10:39
  • So what's stopping you from using OpenCV as e.g. provided by your distro, instead of using miniconda? Or does your distro have a miniconda OpenCV? – dirkt Jul 5 at 11:29
0

Might be dangerous but this seems to do the trick.

ln -sf /usr/local/bin/ffmpeg /root/miniconda3/bin/ffmpeg
  • And it'll work only until the next miniconda install. During which the ffmpeg installed there might overwrite the /usr/local/bin/ffmpeg, depending on how miniconda does the installs. Which would probably cause an interesting bughunt, if it happened. – dirkt Jul 5 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.