Open belalsalih opened 5 months ago
Same issue found on garuda linux
moviepy==1.0.3
Seems issue is related to searching for ffmpeg.exe
no matter the os
As a workaround I changed
FFMPEG_BINARY = os.getenv('FFMPEG_BINARY', 'ffmpeg-imageio')
to
FFMPEG_BINARY = os.getenv('FFMPEG_BINARY', 'auto-detect')
in /venv/lib/python3.9/site-packages/moviepy/config_defaults.py
and error is not present
You can also set the FFMPEG_BINARY=/usr/bin/ffmpeg
(or where your ffmpeg binary is at) in your .env
file - works as well.
since we are using azure devops to build/deploy the code, updating 'config_defaults.py' is not an option. setting up an env variable 'FFMPEG_BINARY=/usr/bin/ffmpeg' as per your suggestion fixed the issue.
thanks alot for the help.
awesome
this is also happening on windows. A temporary fix could be to lock
imageio-ffmpeg<0.5
Same issue found on garuda linux
moviepy==1.0.3
Seems issue is related to searching for
ffmpeg.exe
no matter the os
This would suggest the issue lies with imageio-ffmpeg
and should be fixed there, not in MoviePy.
But a Linux system looking for an exe file does not square with:
this is also happening on windows. A temporary fix could be to lock
imageio-ffmpeg<0.5
@antonpetrov145 Are you sure it's trying to look for an .exe
file? I had a cursory look at imageio-ffmpeg's code and got the impression it is more a matter of misleadingly named variables/function names.
The info about setting the ENV variable is probably the best advice, in any case, as the variable exists for a reason. Though it might make sense to better surface its existence? It's mentioned in the install instructions but not in the project README, for example.
@keikoro if user doesn't set the FFMPEG_BINARY
variable the default is ffmpeg-imageio
FFMPEG_BINARY = os.getenv("FFMPEG_BINARY", "ffmpeg-imageio")
but then
if FFMPEG_BINARY == "ffmpeg-imageio":
from imageio.plugins.ffmpeg import get_exe
FFMPEG_BINARY = get_exe()
my suggestion is to set the default to auto-detect
then if user wants to use ffmpeg-imageio
it can be set with ENV variable. With this the risk of the above error will be much lower IMO.
I tried both my suggestions - set to auto-detect
and set env variable, both work. The question is - do we want to let users set the ENV or we can set to auto-detect
by default in the code and have ffmpeg-imageio
as option not relying on imageio-ffmpeg
.
Changing a default which a) has been in place for a long term, b) is documented and c) can very easily be circumvented by users may make sense in the long term but, as said elsewhere, would need discussing in one of the threads about the future of the project.
It's not something I'd be comfortable taking responsibility for at this point, with the project being kind of in limbo/awaiting review.
ETA: @antonpetrov145 I saw those variables/functions containing the word "exe", but what led you to believe the code is looking for an .exe
file?
@keikoro good, I was confused by the naming of the function, I checked the code for them and yes - my mistake, I will close this PR.
I am trying to run some processing on video uploaded by users using azure functions(python), my code runs perfectly on local pc(macOS) however it is not running at all once deployed on kubernetes. logging into the pod and running: 'from moviepy.editor import *' will result in the following error:
thanks.