"Streaming" MJPG using python.

Posted by tyler on Stack Overflow See other posts from Stack Overflow or by tyler
Published on 2010-06-02T04:34:37Z Indexed on 2010/06/02 4:43 UTC
Read the original article Hit count: 252

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about python

Related posts about camera