title: how to save pygame camera as video output
body: <p>I was try this tutorial Stream Webcam Video to PyGame nothing error.. <a href="https://www.youtube.com/watch?v=H6ijuSmv5N0" rel="nofollow noreferrer">https://www.youtube.com/watch?v=H6ijuSmv5N0</a></p>
  
  <p>and the script like this..</p>
  
  <pre><code>import pygame, sys
  import pygame.camera
  from pygame.locals import *
  
  pygame.init()
  pygame.camera.init()
  
  screen = pygame.display.set_mode((640, 480))
  
  cam = pygame.camera.Camera("/dev/video0", (640, 480))
  cam.start()
  
  while 1:
      image = cam.get_image()
      screen.blit(image, (0,0))
      pygame.display.update()
  
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              #save as video output
              sys.exit()
  </code></pre>
  
  <p>But.. in here I have a problem when I want to save that Stream as video output.. like a mp4, 3gp, avi and other.</p>
  
  <p>In this thread <code>pygame.image.save(img, "image.jpg")</code> save the output as image.
  <a href="https://stackoverflow.com/a/20502651/3445802">https://stackoverflow.com/a/20502651/3445802</a></p>