2017-07-03 25 views
-1

Ich erhalte den Fehler im Titel, wenn ich den folgenden Beispielcode unter Windows 10/Python 3.6.1/Sublime Text Editor 3 ausführen möchte MAGICK_HOME Umgebungsvariable zu zeigen, wo ich ImageMagick manuell installiert habe. Ich habe sichergestellt, dass nur eine Version von ImageMagick installiert ist. Ich habe dafür gesorgt, dass FFMPEG, Numpy, imageio, Decorator und tqdm installiert wurden.MoviePy-Fehler: Das System kann die angegebene Datei nicht finden

Ja, die Datei "vidclip.mp4" existiert. Das gewünschte Verhalten besteht hier darin, einfach das Video abzuschneiden und Text wie in dem Beispiel auf der GitHub-Seite zu der Mitte hinzuzufügen, d. H. Einfach den Code erfolgreich auszuführen.

Weiß jemand, was könnte falsch sein?

Beispielcode aus 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... 

Der vollständige Fehlertrace:

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

Irgendein Grund für den Downvote? Ich würde mich freuen, die Frage zu klären. – JohnSmithy1266

Antwort

0

das Problem gefunden. Ich wusste nicht, dass es imperativ war, dass ich den Speicherort von ffmpeg.exe und convert.exe in ImageMagick Datei angeben. Danach installiere ich MoviePy (in dieser Reihenfolge).

Verwandte Themen