Skip to content

Commit

Permalink
Added ffmpeg download when importing moviepy.editor (#731)
Browse files Browse the repository at this point in the history
When the `FFMPEG_BINARY` environment variable is not set, the ffmpeg binary will be downloaded if needed when `import moviepy.editor` is called.
  • Loading branch information
tburrows13 authored Apr 16, 2018
1 parent e470b71 commit b8fcf45
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion moviepy/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b8fcf45

Please sign in to comment.