2017-07-03 242 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(按照該順序)。

相關問題