Reputation: 451
I am trying to install ffmpeg
in order to use it on OpenAI to record videos. I have installed it using brew install ffmpeg
but somehow when I compile my code I get the same error, it is like the package is not recognized by my virtualenv
where I am working.
Error on Python console:
raise error.DependencyNotInstalled("""Found neither the ffmpeg nor avconv executables. On OS X, you can install ffmpeg via `brew install ffmpeg`. On most Ubuntu variants, `sudo apt-get install ffmpeg` should do it. On Ubuntu 14.04, however, you'll need to install avconv with `sudo apt-get install libav-tools`.""")
However, when I execute which ffmpeg
I got the following path /usr/local/bin/ffmpeg
.
It seems like that Anaconda for example needs a specific command to install this package into its environment, it is the same for virtualenv?
Thanks in advance.
Upvotes: 4
Views: 31790
Reputation: 1
Installing ffmpeg
in conda environment could be could be done with following command in env.
conda install conda-forge::ffmpeg
Upvotes: 0
Reputation: 1309
This question is a little old already, but posting my solution because it could help others.
If you don't use Anaconda (like me) I don't know of a command to install it automatically for you. However, there is a workaround that may work for you.
Go and download the ffmpeg package
you desire (e.g. here).
Then place the ffmpeg.exe
executable in the same folder as you python file you are running. Then this part of your code will run and you won't get the error message you described.
This is not literally in your virtualenv
. However, it will only be found by files you run from inside that directory. Perhaps this solution is close enough.
Alternatively: If you want it to also work when running python files in other folders, you could extract the entire ffmpeg package
to a directory of your choosing. Then add the bin
folder containing the executables (among which ffmpeg.exe
) to your PATH.
Upvotes: 1
Reputation: 697
This is possible. A conda recipe for ffmpeg
is available via the menpo
or conda-forge
channels. Try using this command:
conda create -n newenv -c conda-forge ffmpeg
Upvotes: 6
Reputation: 2044
This is not possible. FFmpeg is a separate application. If you need to use ffmpeg in python, you either need to pip install
a wrapper for python (e.g. ffmpeg-python, ffmpy, etc). But those wrappers does not use the full power of FFmpeg.
Instead what I suggest is to execute command line FFmpeg command in python using subprocess
.
Ref:
Upvotes: 5