【发布时间】:2017-12-07 06:53:21
【问题描述】:
我在尝试在 Windows 10/Python 3.6.1/Sublime Text Editor 3 上运行下面的示例代码时遇到标题错误。我确保将我的 MAGICK_HOME 环境变量设置为指向我的位置手动安装 ImageMagick。我确保只安装了 1 个版本的 ImageMagick。我确保 FFMPEG、Numpy、imageio、Decorator 和 tqdm 都已安装。
是的,文件“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
【问题讨论】:
-
否决票的任何理由?我很乐意解决这个问题。
标签: python-3.x numpy ffmpeg windows-10 moviepy