2017-07-03 175 views
-1

在Windows 10/Python 3.6.1/Sublime Text Editor 3中尝试运行下面的示例代码时,出现标题错误。我确定将我的MAGICK_HOME环境变量指向我手动安装ImageMagick的位置。我确保只安装了1个ImageMagick版本。我确保FFMPEG,Numpy,imageio,Decorator和tqdm都已安装。MoviePy错误:系统找不到指定的文件

是的,文件“vidclip.mp4”存在。这里所期望的行为是根据github页面上的示例简单地裁剪视频并将文本添加到中心,即简单地成功运行代码。

有谁知道什么可能是错的?从github

示例代码:

from moviepy.editor import * 

video = VideoFileClip("vidclip.mp4").subclip(7,64) 

# Make the text. Many more options are available. 
txt_clip = (TextClip("Ken Block who?",fontsize=70,color='white') 
      .set_position('center') 
      .set_duration(10)) 

result = CompositeVideoClip([video, txt_clip]) # Overlay text on video 
result.write_videofile("vidclip_edited.webm",fps=25) # Many options... 

完整的错误跟踪:

Traceback (most recent call last): 
    File "C:\Users\av\AppData\Local\Programs\Python\Python36\lib\site-packages\moviepy\video\VideoClip.py", line 1220, in __init__ 
    subprocess_call(cmd, verbose=False) 
    File "C:\Users\av\AppData\Local\Programs\Python\Python36\lib\site-packages\moviepy\tools.py", line 42, in subprocess_call 
    proc = sp.Popen(cmd, **popen_params) 
    File "C:\Users\av\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 707, in __init__ 
    restore_signals, start_new_session) 
    File "C:\Users\av\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 990, in _execute_child 
    startupinfo) 
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\av\Desktop\Desktop\Projects\Youtube\blender\test\testMoviePy.py", line 6, in <module> 
    txt_clip = (TextClip("Ken Block who?",fontsize=70,color='white') 
    File "C:\Users\av\AppData\Local\Programs\Python\Python36\lib\site-packages\moviepy\video\VideoClip.py", line 1229, 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 
+0

downvote的任何理由?我很乐意解决这个问题。 – JohnSmithy1266

回答

0

发现这个问题。我没有意识到它是命令,我指定的位置ffmpeg.execonvert.exe在ImageMagick的文件。之后,我安装MoviePy(按照该顺序)。

相关问题