本文介绍了尝试添加文本剪辑时,使用Python/MoviePy获得有关ImageMagick的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用python 3.8.5以及imagemagick和moviepy的最新版本

I am using python 3.8.5 as well as the latest version of imagemagick and moviepy

错误(相对于代码):

Traceback (most recent call last):
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\lib\site-packages\moviepy\video\VideoClip.py", line 1137, in __init__
    subprocess_call(cmd, logger=None)
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\lib\site-packages\moviepy\tools.py", line 46, in subprocess_call     
    proc = sp.Popen(cmd, **popen_params)
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:/Users/edgib102/source/repos/Reddit-tts-video/Python/GetComments.py", line 40, in <module>
    TextClip = TextClip('TextTxt', fontsize=100, color = 'white')
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\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] The system cannot find the file specified.

.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

代码:

TextClip = TextClip('TextTxt', fontsize=100, color = 'white')
TextClip = TextClip.set_position('center').set_duration(10)

任何帮助都将不胜感激,也请提供完整代码此处

Any help at all would be much appreciated, also full code here

推荐答案

已解决.只需将 magick.exe 文件路径设置为default_config.py中的变量即可.您可以在moviepy文件夹中找到它.

Solved. Just need to set the magick.exe file path as the variable inside default_config.py. You can find it in the moviepy folder.

这篇关于尝试添加文本剪辑时,使用Python/MoviePy获得有关ImageMagick的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 21:08