Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
moviepy gif loop finder
#!/usr/bin/env python
# Taken from
import os
import sys
import moviepy.editor as mp
from import FramesMatches
if len(sys.argv) != 2:
print " <video file>"
clip = mp.VideoFileClip(sys.argv[1])
name = os.path.splitext(os.path.basename(sys.argv[1]))[0]
scenes = FramesMatches.from_clip(clip.resize(width=120), 5, 2)
selected_scenes = scenes.select_scenes(2, 0.5, 4, 0.5)
selected_scenes.write_gifs(clip.resize(width=270), name)

This comment has been minimized.

Copy link

@Zulko Zulko commented Feb 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment