EricSkiff.com Open Source Everything

23May/114

Example code: capturing webcam vids with flash

This file is a super-simple example of capturing a webcam up to a flash media server
You can use RED5 1.0, Wowza, or FMS for this example - there are demo recording apps
(oflaDemo for red5, vod for Wowza) included with each. Note: red5 .9xx reportedly
does not like the buffered upstream sending we're doing here.

All of the existing examples I could find simply had you "stop" the netstream object
when the user was done record, which, if you have any client-side buffer at all completely
borks the recorded FLV. This example uses a 60 second client-side buffer, which
allows you to capture high-quality webcam videos even if the upstream bandwidth
isn't perfect or consistent. Once the user is done, the buffer continues sending up
the data, and as long as you didn't overflow the client-side buffer, the video should
be perfect.

Filed under: Uncategorized 4 Comments