Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Stream Webcam Video to PyGame - Python - Linux Tutorial

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,033
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Link to this comment:

Share to:

Uploader Comments (metalx1000)

  • amazing! i was looking for some webcam api for python, but pygame does the job! v1.9 is not in deb yet, though. thanks!

  • @Siska0Robert: It's in SID, so it shouldn't be to long. 

  • i get an import error in pygames camera init script! help!

  • @runizgozilla:

    What does the error say?

    Can you post your script at pastebin so I can see it?

    I really can't help if you don't give me any information.

  • @metalx1000 This: import pygame, sys import pygame.camera from pygame.locals import * pygame.init() pygame.camera.init() screen = pygame.display.set_mode(640,48­0) cam = pygame.camera.Camera("/dev/vid­eo0", (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: sys.exit()
  • @runizgozilla: Could you please not post code here? Please post it at some place like pastebin.

see all

All Comments (11)

Sign In or Sign Up now to post a comment!
  • sudo apt-get install python-pygame

    ;)

  • This video is poorly titled, but quality work. Rename it " Video stream from your webcam."

  • @runizgozilla and it won't let me post the error message.

    :3

  • wrong link

    

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more