Monday, April 11, 2011

Python API to access webcam stream?

On college, I needed to create a virtual reality software, and used this Python API to access the stream from the webcam which I came to know through this tutorial. Found out, though, it needed a workaround to work properly.

I remember the stream was a bit slow with resolutions higher than 320x240 but I guess it was a problem on the webcam. For the API, I noticed it, sometimes, gave None objects.

So, my question is: do you guys know any other Python API to access the webcam stream?

Edit: It'd be useful if the API worked both on Windows and Linux, but as I think it'll be harder to find, I'd stick with Windows.

From stackoverflow
  • The only one I've used is VideoCapture, which you've already mentioned you don't like (although I had no problems with it; what bugs did you encounter?)

    I was unable to find any alternatives in the past or now, so you might be stuck either using VideoCapture, or finding a nice C library and writing a Python wrapper for it (which might be more work than you're willing to put into it).

    Rodrigo : Ok, edited the question to define the problem i found.
  • gstreamer can handle webcam input. If I remeber well, there are python bindings for it!

  • OpenCV has support for getting data from a webcam and there are Python wrappers for it:

    http://code.google.com/p/ctypes-opencv/

0 comments:

Post a Comment