Open ralphbean opened 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()
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)
I found the following example code that might be helpful: