Skip to content

Instantly share code, notes, and snippets.

@dedmari
Created May 20, 2017 11:52
Show Gist options
  • Save dedmari/63ff495bff7472b4ded9e5b7da9de8c1 to your computer and use it in GitHub Desktop.
Save dedmari/63ff495bff7472b4ded9e5b7da9de8c1 to your computer and use it in GitHub Desktop.
Extracting Frames from Videos
import pylab
import imageio
import Image
filename = './train01.mp4'
vid = imageio.get_reader(filename, 'ffmpeg')
for i, image in enumerate(vid):
numstr = str(i)
im = Image.fromarray(image)
im.save("train01_"+numstr+".jpeg")
print "Finished with extracting frames from video"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment