I want to extract video frames and save them as image.
import os, sys
from PIL import Image
a, b, c = os.popen3(\"ffmpeg -i test.avi\")
out = c.read()
dp =
There are ffmpeg python modules are available
ffmpeg: https://code.google.com/p/pyffmpeg/
pyAV: https://github.com/mikeboers/PyAV
import av
container = av.open('/path/to/video.mp4')
for packet in container.demux():
for frame in packet.decode():
if frame.type == 'video':
frame.to_image().save('/path/to/frame-%04d.jpg' % frame.index)