Created
May 20, 2017 11:52
-
-
Save dedmari/63ff495bff7472b4ded9e5b7da9de8c1 to your computer and use it in GitHub Desktop.
Extracting Frames from Videos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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