Zulko / moviepy

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

`IMAGEMAGICK_BINARY` on windows #2028

Closed wizardforcel closed 10 months ago

wizardforcel commented 10 months ago

ImageMagick binary on windows is magick.exe, but the cmd is magick convert ...

If I set IMAGEMAGICK_BINARY as magick convert, it doesn't work:

Traceback (most recent call last):
  File "D:\Python310\lib\site-packages\moviepy\video\VideoClip.py", line 1137, in __init__
    subprocess_call(cmd, logger=None)
  File "D:\Python310\lib\site-packages\moviepy\tools.py", line 46, in subprocess_call
    proc = sp.Popen(cmd, **popen_params)
  File "D:\Python310\lib\subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "D:\Python310\lib\subprocess.py", line 1456, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Python310\Scripts\auto-video-script.py", line 33, in <module>
    sys.exit(load_entry_point('BookerAutoVideo==2023.5.30.0', 'console_scripts', 'auto-video')())
  File "D:\Python310\lib\site-packages\bookerautovideo-2023.5.30.0-py3.10.egg\BookerAutoVideo\__main__.py", line 66, in main
    args.func(args)
  File "D:\Python310\lib\site-packages\bookerautovideo-2023.5.30.0-py3.10.egg\BookerAutoVideo\autovideo.py", line 244, in autovideo
    video = make_video(frames)
  File "D:\Python310\lib\site-packages\bookerautovideo-2023.5.30.0-py3.10.egg\BookerAutoVideo\autovideo.py", line 188, in make_video
    TextClip(
  File "D:\Python310\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:

[WinError 2] 系统找不到指定的文件。.

.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
jhermann commented 10 months ago

Set the full path to the magick command, then it works (for me).

export IMAGEMAGICK_BINARY='C:\Program Files\ImageMagick-7.1.1-Q16\magick.exe'

This is for git bash (MingW), but you can also set it in Settings.