views:

152

answers:

0

I have a webcam that I want to do some image processing on using Python.

It's coming through as a Motion-JPEG. I want to try to process the stuff "live," but really what I want to do is this:

  1. Open the URL, start data streaming to some buffer...
  2. Read x bytes (where x is image size) to an image
  3. Process that image
  4. Display in result panel
  5. Return to number 2

The problem is that, while I do have the resolution, I have no idea how many bytes to read. I've tried googling the M-JPEG specification but can't find anything on if the images are separated by some header or what.

Anybody have any ideas?