Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.07k stars 1.51k forks source link

ImageMagick Binary Not Found #2167

Open TheCaptainCodes opened 2 months ago

TheCaptainCodes commented 2 months ago
          ### **What to do for windows?**

I have even changed the file path in config_details.py IMAGEMAGICK_BINARY = os.getenv('IMAGEMAGICK_BINARY', 'C:\Program Files\ImageMagick-7.1.1-31-Q16\magick.exe')

I even tried: from moviepy.config import change_settings change_settings({"IMAGEMAGICK_BINARY": r"C:\Program Files\ImageMagick\\convert.exe"})

What to do now? I get the same error every time:

Traceback (most recent call last): File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\video\VideoClip.py", line 1137, in init subprocess_call(cmd, logger=None) File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\tools.py", line 54, in subprocess_call raise IOError(err.decode('utf8')) OSError: magick.exe: label expected `@C:\Users\LENOVO\AppData\Local\Temp\tmpusxywjtr.txt' @ error/annotate.c/GetMultilineTypeMetrics/804.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:\Fatin\autoyt_vidmaker\main.py", line 31, in makeFinalVideo(story, "./assets/temp/mp3/text_audio.mp3", "./assets/temp/images/antique shop.png", "./assets/temp/video/final_video.mp4") File "F:\Fatin\autoyt_vidmaker\final_video.py", line 14, in makeFinalVideo captions_clip = VideoClip(make_frame, duration=len(words)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\video\VideoClip.py", line 86, in init self.size = self.get_frame(0).shape[:2][::-1] ^^^^^^^^^^^^^^^^^ File "", line 2, in get_frame File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\decorators.py", line 89, in wrapper return f(*new_a, **new_kw) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\Clip.py", line 93, in get_frame return self.make_frame(t) ^^^^^^^^^^^^^^^^^^ File "F:\Fatin\autoyt_vidmaker\final_video.py", line 12, in make_frame return TextClip(caption, fontsize=24, color='white').set_pos('center').set_duration(1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\moviepy\video\VideoClip.py", line 1146, in init raise IOError(error) OSError: MoviePy Error: creation of None failed because of the following error:

magick.exe: label expected `@C:\Users\LENOVO\AppData\Local\Temp\tmpusxywjtr.txt' @ error/annotate.c/GetMultilineTypeMetrics/804. .

.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect

Originally posted by @TheCaptainCodes in https://github.com/Zulko/moviepy/issues/1966#issuecomment-2081525335

arielomdotcom commented 1 month ago

Please provide the module Version, python version, etc.

TheCaptainCodes commented 1 month ago

Please provide the module Version, python version, etc.

Everything's up-to-date

ruangustavo commented 1 month ago

Can you check if you have convert.exe installed?

I was experiencing the same problem, but I noticed that in the latest versions of ImageMagick convert.exe is deprecated and not installed by default

antonpetrov145 commented 4 weeks ago

did you try setting the IMAGEMAGICK_BINARY variable in .env file?