I've been reading about the Flash CS3 Camera class and can't seem to find out if there is any way I can grab a frame or two off the camera and send it to a web server. Is this possible?
Printable View
I've been reading about the Flash CS3 Camera class and can't seem to find out if there is any way I can grab a frame or two off the camera and send it to a web server. Is this possible?
From what I have read about the following classes:
Camera
Video
IBitmapDrawable
DisplayObject
BitmapData
It should be possible to capture a frame into BitmapData. I will leave the details to you, I assume that you have worked out how to send the image to your server.
You should be able to wrap the camera in the video object, then draw than onto a bitmap data (instead of addChilding it). Livedocs are your friend.
I have always used livedocs extensively and I think they could be much better. PHP, for instance, has amazing documentation. I have read the docs on Video and Camera extensively and I've seen code examples and methods that allow you to attachCamera to a video but I have not seen any methods or properties in them that would yield frame data. Seems to me that if its possible to grab a frame from either camera or video or if it's possible to export camera input to a netstream or socket then the documentation should lead you there from these classes.
I'll read the bitmap and display object stuff but I sure could use more tips.
All right, to fill in 69...'s hint a bit more, Video is a DisplayObject, which implements IBitmapDrawable, which means you can draw it to a BitmapData, and from there you have your frame data.
Pretty much. Just BitmapData.draw (Video) and you have your frame data.Quote:
Originally Posted by 5TonsOfFlax
OK this is helpful guys. Thanks! I'll see if I can throw something together and post it here.