Skip to content

Video editing with Python

Added ffmpeg download when importing moviepy.editor (#731)

Tom Burrowsb8fcf456d462
diff --git a/moviepy/editor.py b/moviepy/editor.py
index 5ea3b37c..859f7e70 100644
--- a/moviepy/editor.py
+++ b/moviepy/editor.py
@@ -17,8 +17,15 @@ clip.preview().
# Note that these imports could have been performed in the __init__.py
# file, but this would make the loading of moviepy slower.
-# Clips
+import os
+
+# Downloads ffmpeg if it isn't already installed
+import imageio
+# Checks to see if the user has set a place for their own version of ffmpeg
+if os.getenv('FFMPEG_BINARY', 'ffmpeg-imageio') == 'ffmpeg-imageio':
+ imageio.plugins.ffmpeg.download()
+# Clips
from .video.io.VideoFileClip import VideoFileClip
from .video.io.ImageSequenceClip import ImageSequenceClip
from .video.io.downloader import download_webfile