I'm trying to stream/view a webcam via a python app. I've tried pygame and it works great with an actual pci capture card but v4l complains with even a well known can like logitech. Xawtv works fine with the logitech though.
In pygame I get
SystemError: ioctl(VIDIOC_S_FMT) failure: no supported formats
for the logitech cam.
Other than using an external app like xawtv is there any known ways to view via a python app? I don't want to record just view in 2 sizes 320x240 and 640x480 hopefully with command line switches.
here is the small view app using pygame
Code:
#!/usr/bin/env python
import pygame, sys
import pygame.camera
from pygame.locals import *
pygame.init()
pygame.camera.init()
screen = pygame.display.set_mode((320,240))
cam = pygame.camera.Camera("/dev/video4",(320,240))
cam.start()
while 1:
image = cam.get_image()
screen.blit(image,(0,0))
pygame.display.set_caption(str("TUX PLOT CAM"))
pygame.display.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()