From b8fcf456d462238ab805c2604dfb9ae5b34f25ef Mon Sep 17 00:00:00 2001 From: Tom Burrows <22625968+tburrows13@users.noreply.github.com> Date: Mon, 16 Apr 2018 20:48:40 +0100 Subject: [PATCH] Added ffmpeg download when importing moviepy.editor (#731) When the `FFMPEG_BINARY` environment variable is not set, the ffmpeg binary will be downloaded if needed when `import moviepy.editor` is called. --- moviepy/editor.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/moviepy/editor.py b/moviepy/editor.py index 5ea3b37ce..859f7e70a 100644 --- a/moviepy/editor.py +++ b/moviepy/editor.py @@ -17,8 +17,15 @@ # 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