Silverlight: How to Display the Video from Webcams

In Silverlight, you can access the video and audio feeds from media devices such as webcams and TV tuners. This enables a number of scenarios, such as capturing and displaying images, uploading profile pictures to social networking applications, video diaries, audio diaries, audio note taking, augmented reality, and body gestures.

To set up a webcam in your Silverlight application, the first thing you need to do is get the available AudioCaptureDevices and VideoCaptureDevices on the system. CaptureDeviceConfiguration exposes a number of static members for getting all the available devices as well as getting the default devices. Once you have the device, you can associate it with a CaptureSource.

CaptureSource is the main class used to interact with audio and video devices. Through the CaptureSource you can start and stop the devices, check the state of the devices, and capture a single video frame. A CaptureSource is associated with one AudioCaptureDevice and one VideoCaptureDevice, though it need not be associated with both.

The following example shows how to display the video from a Webcam on a CaptureSource object via a VideoBrush and how to capture a single frame of a video and display it in a CaptureSource:

[silverlight: http://blog.arvixe.com/wp-content/uploads/2012/08/BlogArvixeCom.UserNT.WebCam.xap, 600, 330]

Source Code

Looking for quality Silverlight Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , | Posted under 3rd Party Software, Programming/Coding | RSS 2.0

One Comment on Silverlight: How to Display the Video from Webcams

Leave a Reply

Your email address will not be published. Required fields are marked *


7 − 6 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>