Python-list Digest, Vol 39, Issue 465

Chris Mellon arkanes at gmail.com
Fri Dec 29 16:12:44 EST 2006


On 12/29/06, Ray Schumacher <subscriber100 at rjs.org> wrote:
>
>  At 10:50 AM 12/29/2006, you wrote:
>
> In addition to what Chris said, is there a reason why you're reinventing
>  the wheel instead of using available components?
>  Hi Carsten,
>  The eventual goal here is towards a streaming two-way server, which
> wouldn't use the http, but something more like RTP/RTCP/H.323/ which I'm
> learning. It's also a general socket  learning exercise for me, as I haven't
> used them very much.
>  I was also using PyDShowCam before, and have switched to VideoCapture since
> I'll need to recompile PyDShowCam for py2.4.
>  I will look into the wx Chris suggested this weekend; more stuff I haven't
> used...
>
>  Thanks,
>  Ray
>
>  For anyone interested, I attached a quick wx I made last night that
> monitors a USB webcam, will create "dark" frames (a la astronomy), and serve
> up images to web browsers (thus the question). The browser/monitor would
> actually work nicely with a web page that has a JavaScript function to
> reload the image x times/second. I'll try replacing the PIL with the wx
> function(s) and benchmark if they work.
>

I just double-checked my documentation and wx.Image.GetData() is not
what you want - that's the RGB pixel data, and you want the encoded
stream.

Using pil to save directly to the output buffer is probably the most
efficient mechanism - it doesn't look like wxPython provides
SaveStream (or SaveBuffer). Those probably could be implemented (the
C++ wxImage object supports saving to streams, and SWIG can make a
python FLO look like a stream), you might want to post a feature
request.



More information about the Python-list mailing list