KungFuMasterRat / SURF-2012

2 stars 1 forks source link

Save frames as images #5

Open ralphbean opened 12 years ago

ralphbean commented 12 years ago

I found the following example code that might be helpful:

import pygame
import pygame.camera
pygame.init()
pygame.camera.init()
window = pygame.display.set_mode((640,480),0)
cam = pygame.camera.Camera(0)
cam.start()
image = cam.get_image()
pygame.image.save(image, 'abc.jpg')
cam.stop()
ralphbean commented 12 years ago

We want to save multiple frames though, so we might be able to do it like this:

# We'll need to keep track of a number like frame_number
pygame.image.save(image, 'frame_%i.jpg' % frame_number)