Moslem Hadi
Moslem Hadi

Reputation: 1020

ASP.net - capture video with camera and play in web page

I want to capture video with webcam and play it live in my website.
I dont know what to do!

how can I do that?

Upvotes: 2

Views: 6259

Answers (3)

Andrew Walters
Andrew Walters

Reputation: 4803

You can do this with the in development HTML5 video standards. I remember seeing a working demo of a webcam app like you're talking about in a presentation (Google's HTML can do that I think). Check these pages out for ideas/examples:

http://www.sitepoint.com/stream-your-webcam-to-a-browser-in-javascript/

http://www.iandevlin.com/blog/2012/06/html5/filtering-a-webcam-using-getusermedia-and-html5-canvas

http://www.webrtc.org/

https://wiki.mozilla.org/Platform/Features/Camera_API

Upvotes: 2

Dai
Dai

Reputation: 155250

If you want to display video from a single computer you control (like an old-school "webcam" page) then you'd write some local computer software (presumably using DirectShow or MediaFoundation) that captures frames from your camera and transfers them to your webserver and your page has a simple script that causes the image to be reloaded every second or so. It's not really video, but it's how webcam pages worked until recently.

Now, in 2012, you can serve video directly. You'd want to use something like Apple's "HTTP Video Streaming" where the camera's video stream (not individual frames) is saved into chunks a few seconds in length, then constantly pushed to the server. The webserver then serves a never-ending playlist that lists all of the video chunks just as they're made available, browsers then download the chunks as they're needed. This negates the need for a streaming media server (such as Microsoft's WMS or Adobe's Flash Media Server).

Upvotes: 0

dparsons
dparsons

Reputation: 2866

With pure ASP.NET, you can't. You have several options and the only one that I am aware of in the .NET wheelhouse would be to use Silverlight (e.g. http://www.silverlightshow.net/items/Capturing-the-Webcam-in-Silverlight-4.aspx and http://forums.silverlight.net/t/145729.aspx)

Your other options would be to use Flash or purchase a third party component.

Upvotes: 2

Related Questions