"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: 271
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:
- Open the URL, start data streaming to some buffer...
- Read x bytes (where x is image size) to an image
- Process that image
- Display in result panel
- 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