简体   繁体   中英

how do you record webcam video using asp.net mvc 3 and adobe flash media server?

I want to record a video from webcam in asp.net mvc 3 application and stream it to Adobe Flash Media Server to save the file for later viewing. I have googled for about 2 hours and have had no luck. I must be blind for not finding an answer. Can anyone point me in the right direction? Any links to a decent tutorial or tips?

Thanks!

You're going to need to write an Actionscript application or a Flex application that attaches the webcam to a NetStream, and then publishes that stream to Flash Media Server (FMS). Then compile this app into SWF and embed the SWF in your asp app's HTML.

The Actionscript code for doing this with or without the Flex framework is basically the same. The concepts are:

  • Get access to the webcam, Flash player automatically displays a security dialog asking the user for permission

  • To display the camera output to the user, attach it to a Video object and add the Video to the stage. In a Flex application, the Video object needs to be wrapped in a Flex container (this is only difference).

  • Create a NetConnection and connect it to the FMS. You attach event listeners to the NetConnection to know when it's connected (so you can proceed), or if it fails.

  • After connecting, create a NetStream, attach the webcam to it, and publish to FMS.

Here's an example that someone else was nice enough to write.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM